Repository navigation
feat(cli): add devmap mcp read-only MCP server (Phase 1) - #131
Merged
Merged
Conversation
Run DevMap as an MCP server over stdio so AI agents can query the project
map with tool calls instead of reading dumped context files.
Tools (all read-only, no AI, no disk writes):
- devmap_overview framework, stats, entry points, critical files, features, flows
- devmap_map project / feature / file dependency map
- devmap_flow trace a feature or request end to end
- devmap_routes page/API routes, filter by kind, prefix, method
- devmap_impact dependents, impacts and imports of a file
- devmap_find keyword search over features, files, routes
Resources: devmap://snapshot, devmap://devmap-md, devmap://feature/{id}.
Design:
- every result carries snapshot { generatedAt, stale } plus a hint when stale
- missing/corrupt snapshot -> structured error with the `devmap analyze` hint
- responses are size-capped with an explicit `truncated` flag
- stdout is reserved for JSON-RPC; console.log/info/debug go to stderr
- snapshot provider caches by snapshot.json mtime and memoizes the staleness scan
- feature resource ids are validated (no path traversal)
Tests: 13 in-memory + stdio tests (mcp-server.test.ts) and an MCP smoke test
in the packed-package e2e.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgTNRXcqugxRyJfMKL4AJ2
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✅ Welcome ke DevMap!Terima kasih sudah buat PR. Pastikan checklist ini terpenuhi sebelum review:
CI akan jalan otomatis pada setiap update. Kalau gagal, akan muncul link run di komentar ini. Kalau DevMap membantu, tolong star ya: https://github.com/itsflaid/devmap Terima kasih kontribusinya! 🙏 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ringkasan
Fase 1 dari rencana MCP: command baru
devmap mcp(server MCP via stdio, read-only). Agent bisa bertanya ke peta proyek lewat tool call alih-alih membaca file context yang di-dump.Tool (semua read-only, tanpa AI, tanpa tulis disk)
devmap_overviewdevmap_mapdevmap_flowdevmap_routesdevmap_impactdevmap_findResource:
devmap://snapshot,devmap://devmap-md,devmap://feature/{id}.Keputusan desain
snapshot { generatedAt, stale }+ catatan saat stale.devmap analyze.truncatedeksplisit.console.log/info/debugdialihkan ke stderr.devmap_analyze, auto-refresh, danexplainsengaja belum ada (Fase 2/3).^[a-z0-9][a-z0-9-]*$) → tidak bisa path traversal.Dependency baru
@modelcontextprotocol/sdk^1.32.2 danzod^4.6.7 (runtime dependency package@flaid/devmap).Verifikasi
pnpm test(typecheck + unit): 452/452 (13 tes baru dimcp-server.test.ts, termasuk tes stdio dengan proses sungguhan yang memastikan stdout bersih)pnpm run build✅pnpm run test:package-e2e✅ (ditambah smoke test MCP dari tarball hasil pack: initialize, tools/list, devmap_overview)dist/index.js mcp✅Batasan yang diketahui
devmap_mapdandevmap_flowmemakairunMap/runFlowdari Fase 0, yang memindai file untuk cek stale di setiap panggilan (tidak di-cache seperti tool lain). Cukup untuk MVP; bisa dioptimalkan di Fase 2.devmap mcp(fase akhir: update semua docs + landing page).Generated by Claude Code