project-context-map-mcp 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PROMPTS.md +98 -0
- package/README.md +13 -5
- package/package.json +13 -3
- package/src/cli.js +61 -54
package/PROMPTS.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Prompt Pack
|
|
2
|
+
|
|
3
|
+
This file contains tested starter prompts for `project-context-map-mcp`.
|
|
4
|
+
|
|
5
|
+
These prompts are written for MCP clients such as Claude Code, Cursor, and VS Code Copilot Chat after the server is already connected.
|
|
6
|
+
|
|
7
|
+
## Best General Starter
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Use the `project-context-map` MCP server first. Get the project summary, find the files most relevant to this task: [task], and read only those files before proposing or making changes.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Repo Understanding
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Use the project context map to summarize this repository: main purpose, entrypoints, top modules, hotspots, and how the CLI, server, and indexer fit together.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Use the `project-context-map` MCP server first. Get the project summary, then inspect `src/cli.js`, `src/server.js`, and the project map generation code to explain how startup and indexing work.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Bug Investigation
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
Use the MCP tools to investigate this bug: [bug description]. Start with the project summary, find the relevant files, read only those files, explain the likely root cause, and then propose or apply a fix.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Use the project topology first for this issue: [bug description]. Prefer source files over docs, then inspect only the matched files.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Feature Work
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
I want to add [feature]. Use the project map to identify the impacted modules, relevant files, and likely downstream effects before editing anything.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
Use the `project-context-map` MCP server to find the code paths involved in [feature]. Read only the matched files and make the smallest safe change.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Targeted Code Search
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
Use `query_topology` to find all files related to npm publishing, package configuration, and release safety checks. Then read only the matched source and config files.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Use the MCP tools to find where [system or feature area] is implemented. Show the matched files and why they matter before editing code.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Module Understanding
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Use `get_module_context` for `src` and explain how the CLI, MCP server, ranking, and project map generation fit together.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
Explain the role of `src/cli.js` and how it interacts with `src/server.js`, using the project map and recent changes.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Change Risk
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Use the project map and recent git changes to tell me which files are riskiest to modify for [task].
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
Check recent git changes and project hotspots, then identify the safest place to implement [task].
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Prompt Writing Tips
|
|
74
|
+
|
|
75
|
+
- Broad prompts often rank docs first, especially for words like `project`, `map`, or `MCP`.
|
|
76
|
+
- More precise prompts work better when they mention specific files, modules, or feature areas.
|
|
77
|
+
- A strong workflow is: `get_project_summary` -> `find_relevant_files` or `query_topology` -> `read_files_sparse`.
|
|
78
|
+
- For debugging and implementation, prefer prompts that say `prefer source files over docs`.
|
|
79
|
+
|
|
80
|
+
## Client-Specific Versions
|
|
81
|
+
|
|
82
|
+
### Claude Code
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
Use the `project-context-map` MCP server first. Start with `get_project_summary`, then find the files most relevant to [task], and read only the necessary files before making changes.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Cursor
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Use the connected MCP server `project-context-map` for repo understanding. First get a project summary, then query the most relevant files for: [task]. Read only those files, explain your plan briefly, and then implement the change.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### VS Code Copilot Chat
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
Use the `project-context-map` MCP server to summarize this repo and identify the files relevant to [task].
|
|
98
|
+
```
|
package/README.md
CHANGED
|
@@ -138,6 +138,11 @@ Typical flow:
|
|
|
138
138
|
4. make changes
|
|
139
139
|
5. refresh the map
|
|
140
140
|
|
|
141
|
+
Prompt examples:
|
|
142
|
+
|
|
143
|
+
- See [PROMPTS.md](./PROMPTS.md) for tested starter prompts for Claude Code, Cursor, and VS Code Copilot Chat.
|
|
144
|
+
- For best results, use prompts that name the feature area, module, or source files you want the agent to inspect.
|
|
145
|
+
|
|
141
146
|
---
|
|
142
147
|
|
|
143
148
|
## MCP Config
|
|
@@ -457,11 +462,14 @@ project-context-map-mcp refresh --project-root .
|
|
|
457
462
|
|
|
458
463
|
## Example Prompts For Your MCP Client
|
|
459
464
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
- `
|
|
465
|
+
Tested prompt templates now live in [PROMPTS.md](./PROMPTS.md).
|
|
466
|
+
|
|
467
|
+
Quick examples:
|
|
468
|
+
|
|
469
|
+
- `Use the project context map first, then find the files involved in session refresh logic.`
|
|
470
|
+
- `Use query_topology to locate the files related to npm publishing, package configuration, and release safety checks.`
|
|
471
|
+
- `Use get_module_context for src and explain how the CLI and MCP server fit together.`
|
|
472
|
+
- `Find the files that control authentication and prefer source files over docs.`
|
|
465
473
|
|
|
466
474
|
---
|
|
467
475
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-context-map-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "MCP server and Claude Code skill for project-aware code changes with low token usage.",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "MCP server and Claude Code skill for project-aware code changes with low token usage.\nmcprush.com-2ae221dd5221ac77c562f870",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cli.js",
|
|
7
7
|
"bin": {
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"install-hooks": "node src/cli.js install-hooks",
|
|
14
14
|
"configure-claude": "node src/cli.js configure-claude",
|
|
15
15
|
"print-mcp-config": "node src/cli.js print-mcp-config",
|
|
16
|
-
"
|
|
16
|
+
"lint": "node --check src/cli.js && node --check src/claude.js && node --check src/git.js && node --check src/indexer.js && node --check src/ranker.js && node --check src/server.js && node --check src/utils.js && node --check scripts/install-git-hooks.js && node --check scripts/refresh-map.js && node --check test/claude.test.js && node --check test/helpers.js && node --check test/indexer.test.js && node --check test/ranker.test.js && node --check test/utils.test.js",
|
|
17
|
+
"check": "npm run lint && npm test",
|
|
18
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
|
|
19
|
+
"prepublishOnly": "npm run check"
|
|
17
20
|
},
|
|
18
21
|
"keywords": [
|
|
19
22
|
"mcp",
|
|
@@ -28,6 +31,7 @@
|
|
|
28
31
|
"src",
|
|
29
32
|
"scripts",
|
|
30
33
|
".claude/skills/project-context-map/SKILL.md",
|
|
34
|
+
"PROMPTS.md",
|
|
31
35
|
"README.md"
|
|
32
36
|
],
|
|
33
37
|
"dependencies": {
|
|
@@ -35,5 +39,11 @@
|
|
|
35
39
|
},
|
|
36
40
|
"engines": {
|
|
37
41
|
"node": ">=20"
|
|
42
|
+
},
|
|
43
|
+
"jest": {
|
|
44
|
+
"testEnvironment": "node"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"jest": "^30.3.0"
|
|
38
48
|
}
|
|
39
49
|
}
|
package/src/cli.js
CHANGED
|
@@ -46,65 +46,72 @@ Commands:
|
|
|
46
46
|
const { command, options } = parseArgs(process.argv.slice(2));
|
|
47
47
|
const projectRoot = options["project-root"] || process.cwd();
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
async function main() {
|
|
50
|
+
if (command === "help" || command === "--help" || command === "-h") {
|
|
51
|
+
printHelp();
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
if (command === "serve") {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
if (command === "serve") {
|
|
56
|
+
if (options["project-root"]) {
|
|
57
|
+
process.env.PROJECT_ROOT = projectRoot;
|
|
58
|
+
}
|
|
59
|
+
await startServer();
|
|
60
|
+
return;
|
|
57
61
|
}
|
|
58
|
-
await startServer();
|
|
59
|
-
process.exit(0);
|
|
60
|
-
}
|
|
61
62
|
|
|
62
|
-
if (command === "refresh") {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
63
|
+
if (command === "refresh") {
|
|
64
|
+
refreshMapCli(projectRoot);
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
66
67
|
|
|
67
|
-
if (command === "install-hooks") {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
68
|
+
if (command === "install-hooks") {
|
|
69
|
+
installGitHooks(projectRoot);
|
|
70
|
+
process.exit(0);
|
|
71
|
+
}
|
|
71
72
|
|
|
72
|
-
if (command === "configure-claude") {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
73
|
+
if (command === "configure-claude") {
|
|
74
|
+
const skillPath = writeClaudeSkill(projectRoot);
|
|
75
|
+
const configPath = writeMcpConfig(projectRoot, {
|
|
76
|
+
projectRoot: ".",
|
|
77
|
+
serverName: options["server-name"] || "project-context-map",
|
|
78
|
+
command: options.command || "project-context-map-mcp"
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
process.stdout.write(
|
|
82
|
+
`${JSON.stringify(
|
|
83
|
+
{
|
|
84
|
+
message: "Claude Code skill and .mcp.json created.",
|
|
85
|
+
skillPath,
|
|
86
|
+
configPath
|
|
87
|
+
},
|
|
88
|
+
null,
|
|
89
|
+
2
|
|
90
|
+
)}\n`
|
|
91
|
+
);
|
|
92
|
+
process.exit(0);
|
|
93
|
+
}
|
|
93
94
|
|
|
94
|
-
if (command === "print-mcp-config") {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
if (command === "print-mcp-config") {
|
|
96
|
+
process.stdout.write(
|
|
97
|
+
`${JSON.stringify(
|
|
98
|
+
buildMcpConfig({
|
|
99
|
+
projectRoot: options["project-root"] || ".",
|
|
100
|
+
serverName: options["server-name"] || "project-context-map",
|
|
101
|
+
command: options.command || "project-context-map-mcp"
|
|
102
|
+
}),
|
|
103
|
+
null,
|
|
104
|
+
2
|
|
105
|
+
)}\n`
|
|
106
|
+
);
|
|
107
|
+
process.exit(0);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
printHelp();
|
|
111
|
+
process.exit(1);
|
|
107
112
|
}
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
process.
|
|
114
|
+
await main().catch((error) => {
|
|
115
|
+
process.stderr.write(`${error?.stack || String(error)}\n`);
|
|
116
|
+
process.exit(1);
|
|
117
|
+
});
|