Skip to content

Register the MCP server on init and point agents at its tools - #107

Merged
jimhoyd merged 3 commits into
mainfrom
claude/issue-103-mcp-discovery
Sep 18, 2026
Merged

jimhoyd merged 3 commits into
mainfrom
claude/issue-103-mcp-discovery

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • urlcode init writes .mcp.json at the project root: {"mcpServers":{"urlcode":{"command":"urlcode","args":["mcp","--project","."]}}} (the shape Claude Code and Codex read). init --with writes it once at the site root beside host.mjs with --project app (the app/ copy is lifted out, like the README). Both use exclusive create, so an existing file is never overwritten, and neither carries --allow-authoring: that stays an operator opt-in. renderMcpConfig in src/agents-guide.ts rejects absolute paths and ...
  • starters/default/.mcp.json ships the same bytes; a test keeps starter and generator identical, as for AGENTS.md.
  • The generated AGENTS.md (still under 80 lines) and skills/urlcode/SKILL.md tell agents to prefer get_context, get_capability, get_schema, search_recipes, explain and get_manifest when the server is registered, with urlcode context / capabilities NAME / schema PATH / recipes search / explain / manifest as the fallback, and never to add --allow-authoring themselves.
  • docs/TOOLING.md gains "Registering the server" (Claude Code via .mcp.json, Codex via .mcp.json or config.toml, generic stdio client); one line each in docs/AI-AUTHORING.md and docs/STARTERS.md; llms-full.txt regenerated.

Validation

  • Tests: init writes a parseable .mcp.json with --project .; init --with writes it at the site root with --project app and removes the app/ copy; starter file equals renderMcpConfig('.'); AGENTS.md names every MCP tool.
  • Package smoke: the starter ships .mcp.json and the installed CLI's init writes it.
  • npm run verify green (lint, typecheck, check incl. llms-full, build, 503 tests: 466 pass, 37 skipped, 0 fail).
  • npm run test:package green.

Closes #103

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E


Generated by Claude Code

`urlcode init` writes `.mcp.json` ({"mcpServers":{"urlcode":{"command":"urlcode","args":["mcp","--project","."]}}}), the shape Claude Code and Codex read; `init --with` writes it at the site root beside host.mjs with `--project app`. Existing files are never overwritten (exclusive create), and the file carries no `--allow-authoring`: that stays an operator opt-in.

The starter carries the same file, kept identical to `renderMcpConfig` by test. The generated AGENTS.md and the packaged skill tell agents to prefer `get_context`, `get_capability`, `get_schema`, `search_recipes`, `explain` and `get_manifest` when the server is registered, with the CLI commands as the fallback. docs/TOOLING.md gains "Registering the server" for Claude Code, Codex and a generic stdio client; AI-AUTHORING and STARTERS link to it. Package smoke checks the starter ships `.mcp.json` and that init writes it.

Closes #103

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AQ3ZGqNtWviSYfUMsxU54E
@jimhoyd
jimhoyd merged commit 0b6e898 into main Sep 18, 2026
12 checks passed
@jimhoyd
jimhoyd deleted the claude/issue-103-mcp-discovery branch September 18, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP discovery: init writes .mcp.json, and AGENTS.md and the skill point agents at urlcode mcp

2 participants