diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 00000000..30be382c --- /dev/null +++ b/.mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "code-mcp": { + "type": "http", + "url": "http://localhost:8080/mcp" + } + } +} diff --git a/CLAUDE.md b/CLAUDE.md index 484e2ac8..7f1b179a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -227,6 +227,9 @@ codeiq serve /path/to/repo # needs enrich if using index - `GET /api/intelligence/capabilities` -- Capability matrix ### MCP Tools (34, via `@McpTool` annotation) + +The protocol-level server name is **`CODE MCP`** (set via `spring.ai.mcp.server.name` in `application.yml`). Project-scoped registration lives in `.mcp.json` at the repo root. + `get_stats`, `get_detailed_stats`, `query_nodes`, `query_edges`, `get_node_neighbors`, `get_ego_graph`, `find_cycles`, `find_shortest_path`, `find_consumers`, `find_producers`, `find_callers`, `find_dependencies`, `find_dependents`, `find_dead_code`, `generate_flow`, `run_cypher`, `find_component_by_file`, `trace_impact`, `find_related_endpoints`, `search_graph`, `read_file`, `get_topology`, `service_detail`, `service_dependencies`, `service_dependents`, `blast_radius`, `find_path`, `find_bottlenecks`, `find_circular_deps`, `find_dead_services`, `find_node`, `get_evidence_pack`, `get_artifact_metadata`, `get_capabilities` ## Adding a New Detector diff --git a/README.md b/README.md index 505f43aa..4a71df7d 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,18 @@ java -jar target/code-iq-*-cli.jar serve /path/to/repo # Open http://localhost:8080 ``` +### Use with Claude Code (MCP) + +While `serve` is running, register the MCP server once on your machine: + +```bash +claude mcp add --scope user code-mcp -t http http://localhost:8080/mcp +``` + +The server publishes itself as **`CODE MCP`**. Inside this repo a project-scoped +`.mcp.json` is committed at the root, so cloning + opening in Claude Code +auto-registers it for codeiq development without the manual step. + ## How It Works codeiq scans source files using 99 detectors across 35+ languages, builds a knowledge graph of code relationships, and serves it via REST API, MCP server, and React UI. diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index a55e6e45..cbd04098 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -57,7 +57,7 @@ codeiq: enabled: true spring.ai.mcp.server: - name: codeiq + name: "CODE MCP" version: 0.1.0 protocol: STREAMABLE streamable-http: