claudenv 1.0.1 → 1.1.0
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/README.md +66 -104
- package/bin/cli.js +69 -8
- package/package.json +8 -8
- package/scaffold/.claude/commands/setup-mcp.md +115 -0
- package/scaffold/.claude/commands/update-docs.md +1 -0
- package/scaffold/.claude/skills/doc-generator/SKILL.md +3 -0
- package/scaffold/.claude/skills/doc-generator/templates/mcp-servers.md +168 -0
- package/scaffold/global/.claude/commands/claudenv.md +193 -0
- package/scaffold/global/.claude/commands/setup-mcp.md +115 -0
- package/scaffold/global/.claude/skills/claudenv/SKILL.md +59 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/agents/doc-analyzer.md +70 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/commands/init-docs.md +69 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/commands/setup-mcp.md +115 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/commands/update-docs.md +50 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/commands/validate-docs.md +40 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/skills/doc-generator/SKILL.md +59 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/skills/doc-generator/scripts/validate.sh +108 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/skills/doc-generator/templates/detection-patterns.md +76 -0
- package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/skills/doc-generator/templates/mcp-servers.md +168 -0
- package/scaffold/global/.claude/skills/claudenv/templates/detection-patterns.md +76 -0
- package/scaffold/global/.claude/skills/claudenv/templates/mcp-servers.md +168 -0
- package/src/installer.js +109 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Validate project documentation for completeness and correctness
|
|
3
|
+
allowed-tools: Read, Glob, Grep, Bash(bash:*)
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Validate Project Documentation
|
|
8
|
+
|
|
9
|
+
Run validation checks on the project's Claude Code documentation.
|
|
10
|
+
|
|
11
|
+
## Step 1: Run Bash Validation
|
|
12
|
+
|
|
13
|
+
Execute the validation script:
|
|
14
|
+
!`bash .claude/skills/doc-generator/scripts/validate.sh 2>&1 || true`
|
|
15
|
+
|
|
16
|
+
## Step 2: Deep Validation
|
|
17
|
+
|
|
18
|
+
Perform additional checks that require reading file contents:
|
|
19
|
+
|
|
20
|
+
1. **Read CLAUDE.md** and verify:
|
|
21
|
+
- All `@import` references resolve to existing files
|
|
22
|
+
- Commands in the ## Commands section match actual scripts in package.json / pyproject.toml / Makefile
|
|
23
|
+
- Directories in ## Architecture section actually exist
|
|
24
|
+
|
|
25
|
+
2. **Read .claude/rules/*.md** files and verify:
|
|
26
|
+
- YAML frontmatter `paths` globs match files that exist in the project
|
|
27
|
+
- Referenced tools (linters, formatters, test frameworks) are actually installed
|
|
28
|
+
|
|
29
|
+
3. **Read .claude/settings.json** and verify:
|
|
30
|
+
- Valid JSON structure
|
|
31
|
+
- Referenced hook scripts exist at the specified paths
|
|
32
|
+
|
|
33
|
+
## Step 3: Report
|
|
34
|
+
|
|
35
|
+
Present a clear summary:
|
|
36
|
+
- List all **errors** (things that must be fixed)
|
|
37
|
+
- List all **warnings** (things that should be reviewed)
|
|
38
|
+
- Provide a **pass/fail** verdict
|
|
39
|
+
|
|
40
|
+
If there are errors, suggest specific fixes for each one.
|
package/scaffold/global/.claude/skills/claudenv/scaffold/.claude/skills/doc-generator/SKILL.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doc-generator
|
|
3
|
+
description: Generates and updates project documentation including CLAUDE.md, rules, and hooks. Use when the user asks about documentation, project setup, CLAUDE.md, or when detecting that documentation is missing or outdated.
|
|
4
|
+
allowed-tools: Read, Write, Glob, Grep, Bash(find:*), Bash(cat:*), Bash(node:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Documentation Generator Skill
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
- User mentions documentation, CLAUDE.md, or project setup
|
|
11
|
+
- User asks to configure Claude Code for their project
|
|
12
|
+
- New files detected that change the tech stack (new framework, test runner, etc.)
|
|
13
|
+
- After major refactoring that changes directory structure
|
|
14
|
+
- When CLAUDE.md references files or directories that no longer exist
|
|
15
|
+
- When `.mcp.json` is missing and the project has significant external dependencies
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
### 1. Detect Tech Stack
|
|
20
|
+
Scan the project root for manifest files, framework configs, and tooling:
|
|
21
|
+
|
|
22
|
+
@.claude/skills/doc-generator/templates/detection-patterns.md
|
|
23
|
+
|
|
24
|
+
### 2. Cross-Reference Existing Documentation
|
|
25
|
+
If CLAUDE.md already exists, read it and identify:
|
|
26
|
+
- Outdated commands or directory references
|
|
27
|
+
- Missing entries for new tools/dependencies
|
|
28
|
+
- Stale @imports pointing to removed files
|
|
29
|
+
|
|
30
|
+
### 3. Generate or Update
|
|
31
|
+
- For new documentation: generate CLAUDE.md, _state.md, .claude/rules/code-style.md, .claude/rules/testing.md, .claude/rules/workflow.md
|
|
32
|
+
- For MCP configuration: suggest running `/setup-mcp` to search the MCP Registry and generate `.mcp.json`
|
|
33
|
+
- For updates: propose specific changes and wait for user approval
|
|
34
|
+
- Always present generated content for review before writing
|
|
35
|
+
- NEVER create .md files beyond the ones listed above unless the user explicitly asks
|
|
36
|
+
|
|
37
|
+
### 4. Validate
|
|
38
|
+
After writing, run the validation script:
|
|
39
|
+
```
|
|
40
|
+
bash .claude/skills/doc-generator/scripts/validate.sh
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Fix any errors before completing.
|
|
44
|
+
|
|
45
|
+
## Output Format
|
|
46
|
+
Generated CLAUDE.md should follow this structure:
|
|
47
|
+
- `# CLAUDE.md` heading
|
|
48
|
+
- `## Project overview` — one-sentence description with stack
|
|
49
|
+
- `## Commands` — all dev/build/test/lint commands
|
|
50
|
+
- `## Architecture` — key directories with descriptions
|
|
51
|
+
- `## Conventions` — @imports to code-style.md and testing.md
|
|
52
|
+
- `## Workflow` — @import to workflow.md (Claude Code best practices)
|
|
53
|
+
- `## Memory` — reference to _state.md for session persistence
|
|
54
|
+
- `## Rules` — project-specific rules as bullet points
|
|
55
|
+
|
|
56
|
+
Additionally generate:
|
|
57
|
+
- `_state.md` — project state tracking (decisions, focus, known issues)
|
|
58
|
+
- `.claude/rules/workflow.md` — Claude Code workflow best practices
|
|
59
|
+
- `.mcp.json` — MCP server configuration (via `/setup-mcp`)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Documentation validation script for Claude Code hooks.
|
|
3
|
+
# Exit 0 = success, Exit 2 = block action (sends stderr to Claude).
|
|
4
|
+
# POSIX-compatible for macOS and Linux.
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
ERRORS=0
|
|
8
|
+
WARNINGS=0
|
|
9
|
+
|
|
10
|
+
error() {
|
|
11
|
+
echo "ERROR: $1" >&2
|
|
12
|
+
ERRORS=$((ERRORS + 1))
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
warn() {
|
|
16
|
+
echo "WARN: $1" >&2
|
|
17
|
+
WARNINGS=$((WARNINGS + 1))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
ok() {
|
|
21
|
+
echo "OK: $1"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
# --- Required files ---
|
|
25
|
+
|
|
26
|
+
if [ -f "CLAUDE.md" ] && [ -s "CLAUDE.md" ]; then
|
|
27
|
+
ok "CLAUDE.md exists and is non-empty"
|
|
28
|
+
else
|
|
29
|
+
error "CLAUDE.md is missing or empty"
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# --- Required sections in CLAUDE.md ---
|
|
33
|
+
|
|
34
|
+
if [ -f "CLAUDE.md" ]; then
|
|
35
|
+
for section in "## Commands" "## Architecture"; do
|
|
36
|
+
if grep -q "^${section}" CLAUDE.md 2>/dev/null; then
|
|
37
|
+
ok "CLAUDE.md has ${section}"
|
|
38
|
+
else
|
|
39
|
+
error "CLAUDE.md is missing required section: ${section}"
|
|
40
|
+
fi
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
# Check that ## Commands has at least one backtick-quoted command
|
|
44
|
+
# Use awk instead of head -n -1 for macOS compatibility
|
|
45
|
+
COMMANDS_SECTION=$(sed -n '/^## Commands/,/^## /p' CLAUDE.md | awk 'NR>1{print prev} {prev=$0}')
|
|
46
|
+
if echo "$COMMANDS_SECTION" | grep -q '`'; then
|
|
47
|
+
ok "## Commands section contains command examples"
|
|
48
|
+
else
|
|
49
|
+
warn "## Commands section has no inline code examples"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Check @import references
|
|
53
|
+
while IFS= read -r line; do
|
|
54
|
+
# Skip lines inside code blocks
|
|
55
|
+
case "$line" in
|
|
56
|
+
'```'*) continue ;;
|
|
57
|
+
esac
|
|
58
|
+
# Match bare @path lines (not emails, not inline)
|
|
59
|
+
if echo "$line" | grep -qE '^@[^@[:space:]]+$'; then
|
|
60
|
+
IMPORT_PATH=$(echo "$line" | sed 's/^@//')
|
|
61
|
+
# Resolve ~ to HOME
|
|
62
|
+
case "$IMPORT_PATH" in
|
|
63
|
+
'~/'*) IMPORT_PATH="${HOME}/${IMPORT_PATH#\~/}" ;;
|
|
64
|
+
esac
|
|
65
|
+
if [ -f "$IMPORT_PATH" ]; then
|
|
66
|
+
ok "@import ${IMPORT_PATH} resolves"
|
|
67
|
+
else
|
|
68
|
+
error "@import reference '${IMPORT_PATH}' does not resolve to a file"
|
|
69
|
+
fi
|
|
70
|
+
fi
|
|
71
|
+
done < CLAUDE.md
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# --- Optional structure checks ---
|
|
75
|
+
|
|
76
|
+
if [ -d ".claude" ]; then
|
|
77
|
+
ok ".claude/ directory exists"
|
|
78
|
+
else
|
|
79
|
+
warn ".claude/ directory not found"
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
if [ -f ".claude/settings.json" ]; then
|
|
83
|
+
# Validate JSON syntax (requires python or node)
|
|
84
|
+
if command -v node >/dev/null 2>&1; then
|
|
85
|
+
if node -e "JSON.parse(require('fs').readFileSync('.claude/settings.json','utf-8'))" 2>/dev/null; then
|
|
86
|
+
ok ".claude/settings.json is valid JSON"
|
|
87
|
+
else
|
|
88
|
+
error ".claude/settings.json is not valid JSON"
|
|
89
|
+
fi
|
|
90
|
+
elif command -v python3 >/dev/null 2>&1; then
|
|
91
|
+
if python3 -c "import json; json.load(open('.claude/settings.json'))" 2>/dev/null; then
|
|
92
|
+
ok ".claude/settings.json is valid JSON"
|
|
93
|
+
else
|
|
94
|
+
error ".claude/settings.json is not valid JSON"
|
|
95
|
+
fi
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
# --- Summary ---
|
|
100
|
+
|
|
101
|
+
echo ""
|
|
102
|
+
echo "Validation complete: ${ERRORS} error(s), ${WARNINGS} warning(s)"
|
|
103
|
+
|
|
104
|
+
if [ "$ERRORS" -gt 0 ]; then
|
|
105
|
+
exit 2
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
exit 0
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Tech Stack Detection Patterns
|
|
2
|
+
|
|
3
|
+
Use these patterns to identify the project's tech stack by scanning for files.
|
|
4
|
+
|
|
5
|
+
## Language / Runtime Detection (check manifest files first)
|
|
6
|
+
|
|
7
|
+
| File | Language | Runtime |
|
|
8
|
+
|------|----------|---------|
|
|
9
|
+
| `package.json` | JavaScript/TypeScript | Node.js |
|
|
10
|
+
| `pyproject.toml`, `setup.py`, `requirements.txt` | Python | Python |
|
|
11
|
+
| `go.mod` | Go | Go |
|
|
12
|
+
| `Cargo.toml` | Rust | Rust |
|
|
13
|
+
| `Gemfile` | Ruby | Ruby |
|
|
14
|
+
| `composer.json` | PHP | PHP |
|
|
15
|
+
| `pom.xml`, `build.gradle`, `build.gradle.kts` | Java/Kotlin | JVM |
|
|
16
|
+
| `*.csproj`, `*.sln` | C# | .NET |
|
|
17
|
+
|
|
18
|
+
**TypeScript override**: If `tsconfig.json` exists alongside `package.json`, the language is TypeScript.
|
|
19
|
+
|
|
20
|
+
## Framework Detection (check config files)
|
|
21
|
+
|
|
22
|
+
| File | Framework |
|
|
23
|
+
|------|-----------|
|
|
24
|
+
| `next.config.js/mjs/ts` | Next.js |
|
|
25
|
+
| `nuxt.config.ts/js` | Nuxt |
|
|
26
|
+
| `vite.config.js/ts/mts` | Vite |
|
|
27
|
+
| `svelte.config.js` | SvelteKit |
|
|
28
|
+
| `astro.config.mjs/ts` | Astro |
|
|
29
|
+
| `angular.json` | Angular |
|
|
30
|
+
| `manage.py` | Django |
|
|
31
|
+
| `config/routes.rb` | Rails |
|
|
32
|
+
| `artisan` | Laravel |
|
|
33
|
+
| `application.properties/yml` | Spring Boot |
|
|
34
|
+
|
|
35
|
+
## Package Manager Detection (check lockfiles)
|
|
36
|
+
|
|
37
|
+
| File | Package Manager |
|
|
38
|
+
|------|----------------|
|
|
39
|
+
| `package-lock.json` | npm |
|
|
40
|
+
| `yarn.lock` | Yarn |
|
|
41
|
+
| `pnpm-lock.yaml` | pnpm |
|
|
42
|
+
| `bun.lockb`, `bun.lock` | Bun |
|
|
43
|
+
| `poetry.lock` | Poetry |
|
|
44
|
+
| `Pipfile.lock` | Pipenv |
|
|
45
|
+
| `uv.lock` | uv |
|
|
46
|
+
|
|
47
|
+
## Test Framework Detection
|
|
48
|
+
|
|
49
|
+
| File | Framework |
|
|
50
|
+
|------|-----------|
|
|
51
|
+
| `vitest.config.*` | Vitest |
|
|
52
|
+
| `jest.config.*` | Jest |
|
|
53
|
+
| `playwright.config.*` | Playwright |
|
|
54
|
+
| `cypress.config.*` | Cypress |
|
|
55
|
+
| `pytest.ini`, `conftest.py` | pytest |
|
|
56
|
+
| `.rspec` | RSpec |
|
|
57
|
+
|
|
58
|
+
Also check dependencies in `package.json` or `pyproject.toml`.
|
|
59
|
+
|
|
60
|
+
## CI/CD Detection
|
|
61
|
+
|
|
62
|
+
| Path | System |
|
|
63
|
+
|------|--------|
|
|
64
|
+
| `.github/workflows/*.yml` | GitHub Actions |
|
|
65
|
+
| `.gitlab-ci.yml` | GitLab CI |
|
|
66
|
+
| `Jenkinsfile` | Jenkins |
|
|
67
|
+
| `.circleci/config.yml` | CircleCI |
|
|
68
|
+
|
|
69
|
+
## Monorepo Detection
|
|
70
|
+
|
|
71
|
+
| File | Tool |
|
|
72
|
+
|------|------|
|
|
73
|
+
| `turbo.json` | Turborepo |
|
|
74
|
+
| `nx.json` | Nx |
|
|
75
|
+
| `lerna.json` | Lerna |
|
|
76
|
+
| `pnpm-workspace.yaml` | pnpm workspaces |
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# MCP Server Reference — Registry Search & Configuration
|
|
2
|
+
|
|
3
|
+
## 1. How to Search the Registry
|
|
4
|
+
|
|
5
|
+
The official MCP Registry API provides a searchable catalog of MCP servers. No authentication required.
|
|
6
|
+
|
|
7
|
+
**Endpoint**: `GET https://registry.modelcontextprotocol.io/v0.1/servers`
|
|
8
|
+
|
|
9
|
+
**Parameters**:
|
|
10
|
+
- `search=<term>` — case-insensitive substring match on server names and descriptions
|
|
11
|
+
- `version=latest` — return only the latest version of each server
|
|
12
|
+
- `limit=<n>` — max results per page (default ~100)
|
|
13
|
+
|
|
14
|
+
**Search strategy**:
|
|
15
|
+
1. Analyze the project's tech stack from manifest files, configs, and source code
|
|
16
|
+
2. Extract key technology names (languages, frameworks, databases, cloud services, tools)
|
|
17
|
+
3. Search each technology individually — specific terms yield better results
|
|
18
|
+
|
|
19
|
+
**Example searches**:
|
|
20
|
+
```bash
|
|
21
|
+
# Database
|
|
22
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=postgres&version=latest&limit=10'
|
|
23
|
+
|
|
24
|
+
# Cloud provider
|
|
25
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=aws&version=latest&limit=10'
|
|
26
|
+
|
|
27
|
+
# Monitoring
|
|
28
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=sentry&version=latest&limit=10'
|
|
29
|
+
|
|
30
|
+
# Version control
|
|
31
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=github&version=latest&limit=10'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 2. How to Evaluate and Trust Results
|
|
35
|
+
|
|
36
|
+
### Primary trust signal: npm download counts
|
|
37
|
+
|
|
38
|
+
For each candidate server that has an npm package, check monthly downloads:
|
|
39
|
+
```bash
|
|
40
|
+
curl -s 'https://api.npmjs.org/downloads/point/last-month/<npm-package-name>'
|
|
41
|
+
# Returns: { "downloads": N, "package": "...", ... }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- **Filter out** servers with <100 monthly downloads — likely unmaintained or experimental
|
|
45
|
+
- **Prefer** servers with 10,000+ monthly downloads — well-established and community-trusted
|
|
46
|
+
- **Strong signal** at 100,000+ downloads — widely adopted
|
|
47
|
+
|
|
48
|
+
### Secondary trust signal: GitHub stars
|
|
49
|
+
|
|
50
|
+
If the server has a repository URL, check GitHub stars:
|
|
51
|
+
```bash
|
|
52
|
+
curl -s 'https://api.github.com/repos/<owner>/<repo>'
|
|
53
|
+
# Check the "stargazers_count" field
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Prefer repos with 100+ stars
|
|
57
|
+
- Stars indicate community interest but downloads are a stronger usage signal
|
|
58
|
+
|
|
59
|
+
### Additional evaluation criteria
|
|
60
|
+
|
|
61
|
+
- **Prefer `packages` (npm/stdio) over `remotes` (hosted)** — stdio runs locally with no external dependency
|
|
62
|
+
- **Prefer well-known namespaces**: `io.modelcontextprotocol/*`, `io.github.modelcontextprotocol/*` are official
|
|
63
|
+
- **Read descriptions carefully** — pick servers that match the project's actual use case
|
|
64
|
+
- **Skip** servers that appear to be forks, test entries, or clearly unmaintained
|
|
65
|
+
- **When multiple servers exist for the same tech**, pick the one with highest npm downloads
|
|
66
|
+
- **Check `environmentVariables`** — servers requiring many complex env vars may be harder to set up
|
|
67
|
+
|
|
68
|
+
## 3. How to Build .mcp.json
|
|
69
|
+
|
|
70
|
+
The `.mcp.json` file configures MCP servers for a project. It lives in the project root.
|
|
71
|
+
|
|
72
|
+
**Root structure**:
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"server-name": { ... }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### stdio servers (npm packages)
|
|
82
|
+
|
|
83
|
+
For servers with a `packages` entry of `registryType: "npm"`:
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"server-name": {
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["-y", "<package-identifier>@latest"],
|
|
90
|
+
"env": {
|
|
91
|
+
"VAR_NAME": "${VAR_NAME}"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- Add any `packageArguments` with `type: "positional"` to the `args` array after the package name
|
|
99
|
+
- Map `environmentVariables` to the `env` object
|
|
100
|
+
- Use `${ENV_VAR}` placeholders for all variables with `isSecret: true`
|
|
101
|
+
- Non-secret env vars can use literal values when the value is project-specific and non-sensitive
|
|
102
|
+
|
|
103
|
+
### HTTP/SSE servers (remote)
|
|
104
|
+
|
|
105
|
+
For servers with a `remotes` entry:
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"mcpServers": {
|
|
109
|
+
"server-name": {
|
|
110
|
+
"type": "streamable-http",
|
|
111
|
+
"url": "https://example.com/mcp"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use the `type` and `url` from the remote entry directly. Add `headers` if authentication is needed:
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"type": "streamable-http",
|
|
121
|
+
"url": "https://example.com/mcp",
|
|
122
|
+
"headers": {
|
|
123
|
+
"Authorization": "Bearer ${API_KEY}"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 4. Well-Known Servers
|
|
129
|
+
|
|
130
|
+
These are hints to help find the best option when search results are noisy. Always verify via the registry API — these names and packages may change.
|
|
131
|
+
|
|
132
|
+
| Technology | Search term | Known namespace | Notes |
|
|
133
|
+
|---|---|---|---|
|
|
134
|
+
| Library docs | `context7` | `io.github.upstash/context7` | Up-to-date docs for any library; useful for most projects |
|
|
135
|
+
| GitHub | `github` | `io.github.modelcontextprotocol/github` | Repo management, PRs, issues |
|
|
136
|
+
| PostgreSQL | `postgres` | `io.github.modelcontextprotocol/postgres` | Database queries; prefer read-only config |
|
|
137
|
+
| Filesystem | `filesystem` | `io.github.modelcontextprotocol/filesystem` | Scoped file access |
|
|
138
|
+
| Fetch | `fetch` | `io.github.modelcontextprotocol/fetch` | Web content retrieval |
|
|
139
|
+
| Sentry | `sentry` | — | Error tracking integration |
|
|
140
|
+
| Stripe | `stripe` | — | Payment API |
|
|
141
|
+
| Docker | `docker` | — | Container management |
|
|
142
|
+
| AWS | `aws` | — | Cloud services |
|
|
143
|
+
| Redis | `redis` | — | Cache and data store |
|
|
144
|
+
| MongoDB | `mongodb` | — | Document database |
|
|
145
|
+
| Slack | `slack` | — | Team communication |
|
|
146
|
+
| Linear | `linear` | — | Issue tracking |
|
|
147
|
+
|
|
148
|
+
## 5. Security Rules
|
|
149
|
+
|
|
150
|
+
### Secrets management
|
|
151
|
+
- **NEVER** put actual secret values in `.mcp.json` — use `${ENV_VAR}` placeholders
|
|
152
|
+
- Secret values go in `~/.claude.json` (user-level config, not committed to version control)
|
|
153
|
+
- Tell the user how to configure each secret:
|
|
154
|
+
```
|
|
155
|
+
claude config set env.VAR_NAME "actual-value"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Safe to commit
|
|
159
|
+
- `.mcp.json` is safe to commit to version control — it contains only placeholders, never real secrets
|
|
160
|
+
- Add `.mcp.json` to the git commit alongside other Claude Code config files
|
|
161
|
+
|
|
162
|
+
### Database safety
|
|
163
|
+
- Prefer read-only database connection strings
|
|
164
|
+
- If read-write access is needed, document this clearly in the recommendation
|
|
165
|
+
|
|
166
|
+
### Principle of least privilege
|
|
167
|
+
- Only recommend servers that the project actually needs
|
|
168
|
+
- Prefer servers with narrow, well-defined capabilities over general-purpose ones
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Tech Stack Detection Patterns
|
|
2
|
+
|
|
3
|
+
Use these patterns to identify the project's tech stack by scanning for files.
|
|
4
|
+
|
|
5
|
+
## Language / Runtime Detection (check manifest files first)
|
|
6
|
+
|
|
7
|
+
| File | Language | Runtime |
|
|
8
|
+
|------|----------|---------|
|
|
9
|
+
| `package.json` | JavaScript/TypeScript | Node.js |
|
|
10
|
+
| `pyproject.toml`, `setup.py`, `requirements.txt` | Python | Python |
|
|
11
|
+
| `go.mod` | Go | Go |
|
|
12
|
+
| `Cargo.toml` | Rust | Rust |
|
|
13
|
+
| `Gemfile` | Ruby | Ruby |
|
|
14
|
+
| `composer.json` | PHP | PHP |
|
|
15
|
+
| `pom.xml`, `build.gradle`, `build.gradle.kts` | Java/Kotlin | JVM |
|
|
16
|
+
| `*.csproj`, `*.sln` | C# | .NET |
|
|
17
|
+
|
|
18
|
+
**TypeScript override**: If `tsconfig.json` exists alongside `package.json`, the language is TypeScript.
|
|
19
|
+
|
|
20
|
+
## Framework Detection (check config files)
|
|
21
|
+
|
|
22
|
+
| File | Framework |
|
|
23
|
+
|------|-----------|
|
|
24
|
+
| `next.config.js/mjs/ts` | Next.js |
|
|
25
|
+
| `nuxt.config.ts/js` | Nuxt |
|
|
26
|
+
| `vite.config.js/ts/mts` | Vite |
|
|
27
|
+
| `svelte.config.js` | SvelteKit |
|
|
28
|
+
| `astro.config.mjs/ts` | Astro |
|
|
29
|
+
| `angular.json` | Angular |
|
|
30
|
+
| `manage.py` | Django |
|
|
31
|
+
| `config/routes.rb` | Rails |
|
|
32
|
+
| `artisan` | Laravel |
|
|
33
|
+
| `application.properties/yml` | Spring Boot |
|
|
34
|
+
|
|
35
|
+
## Package Manager Detection (check lockfiles)
|
|
36
|
+
|
|
37
|
+
| File | Package Manager |
|
|
38
|
+
|------|----------------|
|
|
39
|
+
| `package-lock.json` | npm |
|
|
40
|
+
| `yarn.lock` | Yarn |
|
|
41
|
+
| `pnpm-lock.yaml` | pnpm |
|
|
42
|
+
| `bun.lockb`, `bun.lock` | Bun |
|
|
43
|
+
| `poetry.lock` | Poetry |
|
|
44
|
+
| `Pipfile.lock` | Pipenv |
|
|
45
|
+
| `uv.lock` | uv |
|
|
46
|
+
|
|
47
|
+
## Test Framework Detection
|
|
48
|
+
|
|
49
|
+
| File | Framework |
|
|
50
|
+
|------|-----------|
|
|
51
|
+
| `vitest.config.*` | Vitest |
|
|
52
|
+
| `jest.config.*` | Jest |
|
|
53
|
+
| `playwright.config.*` | Playwright |
|
|
54
|
+
| `cypress.config.*` | Cypress |
|
|
55
|
+
| `pytest.ini`, `conftest.py` | pytest |
|
|
56
|
+
| `.rspec` | RSpec |
|
|
57
|
+
|
|
58
|
+
Also check dependencies in `package.json` or `pyproject.toml`.
|
|
59
|
+
|
|
60
|
+
## CI/CD Detection
|
|
61
|
+
|
|
62
|
+
| Path | System |
|
|
63
|
+
|------|--------|
|
|
64
|
+
| `.github/workflows/*.yml` | GitHub Actions |
|
|
65
|
+
| `.gitlab-ci.yml` | GitLab CI |
|
|
66
|
+
| `Jenkinsfile` | Jenkins |
|
|
67
|
+
| `.circleci/config.yml` | CircleCI |
|
|
68
|
+
|
|
69
|
+
## Monorepo Detection
|
|
70
|
+
|
|
71
|
+
| File | Tool |
|
|
72
|
+
|------|------|
|
|
73
|
+
| `turbo.json` | Turborepo |
|
|
74
|
+
| `nx.json` | Nx |
|
|
75
|
+
| `lerna.json` | Lerna |
|
|
76
|
+
| `pnpm-workspace.yaml` | pnpm workspaces |
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# MCP Server Reference — Registry Search & Configuration
|
|
2
|
+
|
|
3
|
+
## 1. How to Search the Registry
|
|
4
|
+
|
|
5
|
+
The official MCP Registry API provides a searchable catalog of MCP servers. No authentication required.
|
|
6
|
+
|
|
7
|
+
**Endpoint**: `GET https://registry.modelcontextprotocol.io/v0.1/servers`
|
|
8
|
+
|
|
9
|
+
**Parameters**:
|
|
10
|
+
- `search=<term>` — case-insensitive substring match on server names and descriptions
|
|
11
|
+
- `version=latest` — return only the latest version of each server
|
|
12
|
+
- `limit=<n>` — max results per page (default ~100)
|
|
13
|
+
|
|
14
|
+
**Search strategy**:
|
|
15
|
+
1. Analyze the project's tech stack from manifest files, configs, and source code
|
|
16
|
+
2. Extract key technology names (languages, frameworks, databases, cloud services, tools)
|
|
17
|
+
3. Search each technology individually — specific terms yield better results
|
|
18
|
+
|
|
19
|
+
**Example searches**:
|
|
20
|
+
```bash
|
|
21
|
+
# Database
|
|
22
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=postgres&version=latest&limit=10'
|
|
23
|
+
|
|
24
|
+
# Cloud provider
|
|
25
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=aws&version=latest&limit=10'
|
|
26
|
+
|
|
27
|
+
# Monitoring
|
|
28
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=sentry&version=latest&limit=10'
|
|
29
|
+
|
|
30
|
+
# Version control
|
|
31
|
+
curl -s 'https://registry.modelcontextprotocol.io/v0.1/servers?search=github&version=latest&limit=10'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 2. How to Evaluate and Trust Results
|
|
35
|
+
|
|
36
|
+
### Primary trust signal: npm download counts
|
|
37
|
+
|
|
38
|
+
For each candidate server that has an npm package, check monthly downloads:
|
|
39
|
+
```bash
|
|
40
|
+
curl -s 'https://api.npmjs.org/downloads/point/last-month/<npm-package-name>'
|
|
41
|
+
# Returns: { "downloads": N, "package": "...", ... }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- **Filter out** servers with <100 monthly downloads — likely unmaintained or experimental
|
|
45
|
+
- **Prefer** servers with 10,000+ monthly downloads — well-established and community-trusted
|
|
46
|
+
- **Strong signal** at 100,000+ downloads — widely adopted
|
|
47
|
+
|
|
48
|
+
### Secondary trust signal: GitHub stars
|
|
49
|
+
|
|
50
|
+
If the server has a repository URL, check GitHub stars:
|
|
51
|
+
```bash
|
|
52
|
+
curl -s 'https://api.github.com/repos/<owner>/<repo>'
|
|
53
|
+
# Check the "stargazers_count" field
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Prefer repos with 100+ stars
|
|
57
|
+
- Stars indicate community interest but downloads are a stronger usage signal
|
|
58
|
+
|
|
59
|
+
### Additional evaluation criteria
|
|
60
|
+
|
|
61
|
+
- **Prefer `packages` (npm/stdio) over `remotes` (hosted)** — stdio runs locally with no external dependency
|
|
62
|
+
- **Prefer well-known namespaces**: `io.modelcontextprotocol/*`, `io.github.modelcontextprotocol/*` are official
|
|
63
|
+
- **Read descriptions carefully** — pick servers that match the project's actual use case
|
|
64
|
+
- **Skip** servers that appear to be forks, test entries, or clearly unmaintained
|
|
65
|
+
- **When multiple servers exist for the same tech**, pick the one with highest npm downloads
|
|
66
|
+
- **Check `environmentVariables`** — servers requiring many complex env vars may be harder to set up
|
|
67
|
+
|
|
68
|
+
## 3. How to Build .mcp.json
|
|
69
|
+
|
|
70
|
+
The `.mcp.json` file configures MCP servers for a project. It lives in the project root.
|
|
71
|
+
|
|
72
|
+
**Root structure**:
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"server-name": { ... }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### stdio servers (npm packages)
|
|
82
|
+
|
|
83
|
+
For servers with a `packages` entry of `registryType: "npm"`:
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"server-name": {
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["-y", "<package-identifier>@latest"],
|
|
90
|
+
"env": {
|
|
91
|
+
"VAR_NAME": "${VAR_NAME}"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- Add any `packageArguments` with `type: "positional"` to the `args` array after the package name
|
|
99
|
+
- Map `environmentVariables` to the `env` object
|
|
100
|
+
- Use `${ENV_VAR}` placeholders for all variables with `isSecret: true`
|
|
101
|
+
- Non-secret env vars can use literal values when the value is project-specific and non-sensitive
|
|
102
|
+
|
|
103
|
+
### HTTP/SSE servers (remote)
|
|
104
|
+
|
|
105
|
+
For servers with a `remotes` entry:
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"mcpServers": {
|
|
109
|
+
"server-name": {
|
|
110
|
+
"type": "streamable-http",
|
|
111
|
+
"url": "https://example.com/mcp"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use the `type` and `url` from the remote entry directly. Add `headers` if authentication is needed:
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"type": "streamable-http",
|
|
121
|
+
"url": "https://example.com/mcp",
|
|
122
|
+
"headers": {
|
|
123
|
+
"Authorization": "Bearer ${API_KEY}"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 4. Well-Known Servers
|
|
129
|
+
|
|
130
|
+
These are hints to help find the best option when search results are noisy. Always verify via the registry API — these names and packages may change.
|
|
131
|
+
|
|
132
|
+
| Technology | Search term | Known namespace | Notes |
|
|
133
|
+
|---|---|---|---|
|
|
134
|
+
| Library docs | `context7` | `io.github.upstash/context7` | Up-to-date docs for any library; useful for most projects |
|
|
135
|
+
| GitHub | `github` | `io.github.modelcontextprotocol/github` | Repo management, PRs, issues |
|
|
136
|
+
| PostgreSQL | `postgres` | `io.github.modelcontextprotocol/postgres` | Database queries; prefer read-only config |
|
|
137
|
+
| Filesystem | `filesystem` | `io.github.modelcontextprotocol/filesystem` | Scoped file access |
|
|
138
|
+
| Fetch | `fetch` | `io.github.modelcontextprotocol/fetch` | Web content retrieval |
|
|
139
|
+
| Sentry | `sentry` | — | Error tracking integration |
|
|
140
|
+
| Stripe | `stripe` | — | Payment API |
|
|
141
|
+
| Docker | `docker` | — | Container management |
|
|
142
|
+
| AWS | `aws` | — | Cloud services |
|
|
143
|
+
| Redis | `redis` | — | Cache and data store |
|
|
144
|
+
| MongoDB | `mongodb` | — | Document database |
|
|
145
|
+
| Slack | `slack` | — | Team communication |
|
|
146
|
+
| Linear | `linear` | — | Issue tracking |
|
|
147
|
+
|
|
148
|
+
## 5. Security Rules
|
|
149
|
+
|
|
150
|
+
### Secrets management
|
|
151
|
+
- **NEVER** put actual secret values in `.mcp.json` — use `${ENV_VAR}` placeholders
|
|
152
|
+
- Secret values go in `~/.claude.json` (user-level config, not committed to version control)
|
|
153
|
+
- Tell the user how to configure each secret:
|
|
154
|
+
```
|
|
155
|
+
claude config set env.VAR_NAME "actual-value"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Safe to commit
|
|
159
|
+
- `.mcp.json` is safe to commit to version control — it contains only placeholders, never real secrets
|
|
160
|
+
- Add `.mcp.json` to the git commit alongside other Claude Code config files
|
|
161
|
+
|
|
162
|
+
### Database safety
|
|
163
|
+
- Prefer read-only database connection strings
|
|
164
|
+
- If read-write access is needed, document this clearly in the recommendation
|
|
165
|
+
|
|
166
|
+
### Principle of least privilege
|
|
167
|
+
- Only recommend servers that the project actually needs
|
|
168
|
+
- Prefer servers with narrow, well-defined capabilities over general-purpose ones
|