Add claude-code-spring module: CLAUDE.md, a path-scoped rule, two skills, four hooks run against real hook JSON, project .mcp.json from the claude mcp CLI, and tests that lint the setup on Spring Boot 4.2.0

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b86yyhhudsSLnwNUFY
This commit is contained in:
Ankur Mhatre
2026-11-22 02:05:35 +05:30
co-authored by Claude Sonnet 5.5
parent a620d91d0a
commit 3aa20a1dce
40 changed files with 1175 additions and 0 deletions
+86
View File
@@ -0,0 +1,86 @@
claude --version: 2.1.330 (Claude Code)
$ claude mcp add --scope project --transport stdio gitea --env GITEA_HOST=https://ankurm.com/git.app --env GITEA_ACCESS_TOKEN=${GITEA_TOKEN} -- gitea-mcp -t stdio
Added stdio MCP server gitea with command: gitea-mcp -t stdio to project config
File modified: <tmp>/project/.mcp.json
$ claude mcp add --scope project --transport stdio db -- npx -y @bytebase/[email protected] --transport stdio --dsn ${DB_URL}
Added stdio MCP server db with command: npx -y @bytebase/[email protected] --transport stdio --dsn ${DB_URL} to project config
File modified: <tmp>/project/.mcp.json
$ cat .mcp.json
{
"mcpServers": {
"gitea": {
"type": "stdio",
"command": "gitea-mcp",
"args": [
"-t",
"stdio"
],
"env": {
"GITEA_HOST": "https://ankurm.com/git.app",
"GITEA_ACCESS_TOKEN": "${GITEA_TOKEN}"
}
},
"db": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@bytebase/[email protected]",
"--transport",
"stdio",
"--dsn",
"${DB_URL}"
],
"env": {}
}
}
}
committed .mcp.json identical to the generated one: yes
$ claude mcp list (GITEA_TOKEN and DB_URL unset)
Checking MCP server health…
gitea: gitea-mcp -t stdio - ⏸ Pending approval (run `claude` to approve)
db: npx -y @bytebase/[email protected] --transport stdio --dsn ${DB_URL} - ⏸ Pending approval (run `claude` to approve)
MCP config diagnostics ‼
For help configuring MCP servers, see: https://code.claude.com/docs/en/mcp
[Has warnings] Project config (shared via .mcp.json)
Location: <tmp>/project/.mcp.json
├ [Warning] [gitea] mcpServers.gitea: Missing environment variables: GITEA_TOKEN
└ [Warning] [db] mcpServers.db: Missing environment variables: DB_URL
$ claude mcp get gitea
gitea:
Scope: Project config (shared via .mcp.json)
Status: ⏸ Pending approval (run `claude` to approve)
Type: stdio
Command: gitea-mcp
Args: -t stdio
Environment:
GITEA_HOST=https://ankurm.com/git.app
GITEA_ACCESS_TOKEN=${GITEA_TOKEN}
To remove this server, run: claude mcp remove gitea -s project
$ GITEA_TOKEN=x DB_URL=x claude mcp list
Checking MCP server health…
gitea: gitea-mcp -t stdio - ⏸ Pending approval (run `claude` to approve)
db: npx -y @bytebase/[email protected] --transport stdio --dsn ${DB_URL} - ⏸ Pending approval (run `claude` to approve)
--- a hand-written entry that has a url but no "type"
$ claude mcp list
No MCP servers configured. Use `claude mcp add` to add a server.
MCP config diagnostics ‼
For help configuring MCP servers, see: https://code.claude.com/docs/en/mcp
[Has warnings] Project config (shared via .mcp.json)
Location: <tmp>/bad/.mcp.json
└ [Warning] [remote] mcpServers.remote: Skipped — MCP server "remote" has a "url" but no "type"; add "type": "http" (or "sse" / "ws") to this entry
--- scope precedence: the same server name in user and local scope
Added HTTP MCP server docs with URL: https://user-scope.invalid/mcp to user config
Added HTTP MCP server docs with URL: https://local-scope.invalid/mcp to local config
$ claude mcp get docs (Scope and URL lines only)
Scope: Local config (private to you in this project)
URL: https://local-scope.invalid/mcp