add-mcp-skeleton
Skill1 starsChanged 9 months agoMITView on GitHub
Scaffold a new MCP server for NanoClaw and wire it into the agent runner. Use when user asks to "add MCP", "integrate a tool", "connect to API", "FastMCP", or wants new tools available inside the container.
In this repository14 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-gmailSkill
- add-parallelSkill
- add-telegramSkill
- add-telegram-swarmSkill
- add-voice-transcriptionSkill
- convert-to-dockerSkill
- customizeSkill
- debugSkill
- pr-reviewSkill
- setup-macmini-24x7Skill
- setup-minimaxSkill
- setupSkill
- x-integrationSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Prefer @modelcontextprotocol/sdk with StdioServerTransport.
- Very specific: line 30
Keep existing nanoclaw server.
- Distinctive: line 36
If you need per-group enablement:
- Very specific: line 53
Keep tools narrow: validate inputs with zod and return structured errors.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add MCP Skeleton
Goal: create a minimal MCP server (TypeScript) and expose it to Claude Agent SDK inside the container.
0) Ask 3 things
- MCP server name (id): e.g.
accounting - What tools (read-only vs read-write)
- Which groups should have access (main only vs all vs specific group)
1) Create MCP package
Create container/mcp/<id>/:
package.json(type=module)tsconfig.jsonsrc/index.ts(stdio server)
Prefer @modelcontextprotocol/sdk with StdioServerTransport.
2) Wire into agent runner
Edit container/agent-runner/src/index.ts where mcpServers is configured.
Pattern:
- Keep existing
nanoclawserver. - Add
<id>server:command: 'node'args: ['/workspace/project/container/mcp/<id>/dist/index.js']if project is mounted- Or vendor it into the image (preferred for non-main groups)
If you need per-group enablement:
- gate it by an env var like
NANOCLAW_ENABLE_MCP_<ID>=1that you set via per-groupsettings.jsonenv.
3) Build and test
Rebuild:
npm test
npm run build
./container/build.shSmoke test tool discovery by asking the agent to call the tool once.
Notes
- Don’t mount secrets as files. Pass secrets via NanoClaw
secretsplumbing or host env. - Keep tools narrow: validate inputs with
zodand return structured errors.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

