r/modelcontextprotocol • • 1d ago

new-release Built project-context-map-mcp: A stdio MCP server that indexes repo import topology & git hotspots so coding agents read fewer files (MIT, on Official MCP Registry)

I built project-context-map-mcp (MIT, Node.js >=20, pure ESM on u/modelcontextprotocol/sdk) to solve a common MCP coding-agent bottleneck: clients burning tokens opening 15–25 files just to map out a repo before editing.

Design & Protocol Choices

Instead of letting the agent scan everything blindly, the server indexes the repository into .project.md (with a Mermaid topology diagram + change log), .project-map.json, and .project-map.md, and exposes 10 focused tools over StdioServerTransport:

  • Discovery & Ranking: get_project_summary, read_project_context, query_topology (returns matched paths + dependencies & usedBy edges), find_relevant_files (with confidence and avoidReading modules), get_module_context, explain_file_role, get_recent_git_changes
  • Scoped File Access & Writes: read_files_sparse (restricts reads to indexed, in-root paths) and write_and_log (writes in-root files and appends to .project.md's Change Log)
  • Safety & Testing: Enforces lexical + realpathSync symlink-traversal checks on file reads/writes, validates tool arguments with structured isError responses, and tests handlers end-to-end using InMemoryTransport.

Try it (npx or Official MCP Registry)

{
  "mcpServers": {
    "project-context-map": {
      "command": "npx",
      "args": ["-y", "project-context-map-mcp", "serve", "--project-root", "."]
    }
  }
}

If it's useful in your MCP workflow, a ⭐ on GitHub helps others find it. Curious what other MCP builders think: do you prefer servers that only expose read/query tools (query_topology), or do you also use scoped read/write helpers (read_files_sparse, write_and_log) alongside your client's built-in file tools?

2 Upvotes

0 comments sorted by