kiid-mcp developer guide
Run the forge on your own machine, turn an OpenAPI document into a working MCP server, then start and test that server locally: over REST, over MCP and in the chat UI.
How it works
The CLI you install never contains the generator. It reads your spec, sends it to the forge service and writes the project it gets back. The forged project is thin glue that references the compiled ProjectKiid.Mcp.* runtime packages.
The hosted forge at generate.ostersono.com is not live yet, so during development you run the forge service yourself and point the CLI at it.
Prerequisites
- .NET 10 SDK
- Docker Desktop, running, for the forged server's PostgreSQL audit store (any PostgreSQL 14+ also works)
- Node.js 20+ for the kiid-chat UI and the MCP Inspector (optional)
- Access to the ProjectKiid package feed, so forged projects can restore
ProjectKiid.Mcp.*
Start the forge service
Open a terminal in the repository root and leave this running:
dotnet build ProjectKiid.slnx -c Release dotnet run -c Release --no-build --project src/Kiid.McpForge.Server --urls http://localhost:5199
Check it is up:
Invoke-RestMethod http://localhost:5199/health # status: okInstall the CLI
The CLI is a .NET global tool. Pack it with a fresh dev version and install it; the same command updates an existing install.
$v = "1.0.0-dev." + (Get-Date -Format yyyyMMddHHmm) dotnet pack src/Kiid.McpForge/Kiid.McpForge.csproj -c Release -p:Version=$v -o .\.localfeed dotnet tool update -g ProjectKiid.McpForge --version $v --add-source .\.localfeed
$env:Path = [Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [Environment]::GetEnvironmentVariable("Path","User")Without installing, run the build output directly: .\src\Kiid.McpForge\bin\Release\net10.0\kiid-mcp.exe
Forge a server
Point the CLI at your local forge once per terminal, then pick how you want to work.
$env:KIID_MCP_ENDPOINT = "http://localhost:5199"
kiid-mcp
The wizard asks, in order: which model polishes descriptions (Claude, OpenAI, Ollama or none), the OpenAPI file or URL, then shows the planned tools for you to confirm, then the solution name, output folder, port, and whether to build and test.
claude mcp add kiid-mcp -- kiid-mcp serve
Then ask the agent in Claude Code, Cursor or VS Code: "Make an MCP server from ./openapi.json into C:\src\Orders.Mcp". It calls inspect_openapi and scaffold_mcp_server for you.
kiid-mcp inspect --spec ./openapi.json # preview tools, write nothing
kiid-mcp new --spec ./openapi.json --out ./Orders.Mcp --name Acme.Orders.Mcp| Option | What it does |
|---|---|
--spec | OpenAPI 2.0 / 3.0 file or URL, JSON or YAML. Required. |
--out, --name | Output folder and solution name. Defaults come from the API title. |
--tags a,b | Only forge operations with these OpenAPI tags. |
--provider, --model | Optional model that polishes descriptions, e.g. anthropic + claude-opus-5-5. |
--port | HTTP port of the forged server (default 5080). |
--service | Forge endpoint for this command only, instead of KIID_MCP_ENDPOINT. |
--no-build, --no-test, --force | Skip verification, or overwrite a non-empty folder. |
The run ends with a Ready panel showing the folder, the tool count, and build and test results. Every forged project has its own README with a "Run it locally" guide written for that API.
Run the forged server locally
-
Start PostgreSQL. Every call is audited first; with the database down the server refuses to call your API.
cd C:\src\Orders.Mcp docker compose up -d postgres
-
Give it the upstream credentials. The forged README names the exact scheme. For an API key header, the header name is already in
appsettings.json; only the key is needed:dotnet user-secrets --project src/Orders.Mcp.Api set "Upstream:ApiKey" "<your-api-key>" # bearer: "Upstream:BearerToken" basic: "Upstream:Username" + "Upstream:Password" -
Run it.
Port taken? Add
dotnet run --project src/Orders.Mcp.Api # http://localhost:5080--urls http://localhost:<port>. - Open
http://localhost:5080/docsfor the Scalar API reference and try any endpoint from the browser.
Test it
REST, from a terminal
irm http://localhost:5080/api/info # server, upstream, tool counts irm http://localhost:5080/api/tools | ft name, method, path, risk # the tool catalog irm http://localhost:5080/api/tools/<tool>/invoke # real call, read-only tools irm "http://localhost:5080/api/ask?q=list all orders" # natural language irm "http://localhost:5080/api/intent/classify?q=delete order 5" # dry run, calls nothing irm http://localhost:5080/api/audit?take=10 # every call, every channel
Writes need POST, and destructive tools are refused until the body includes "confirm": true. The forged project also ships a .http file with ready-made requests for VS Code and Visual Studio.
MCP protocol
npx @modelcontextprotocol/inspector --cli http://localhost:5080/mcp --transport http --method tools/list
npx @modelcontextprotocol/inspector --cli http://localhost:5080/mcp --transport http --method tools/call --tool-name <tool>
npx @modelcontextprotocol/inspector # browser UIA real AI client
claude mcp add --transport http orders-mcp http://localhost:5080/mcp
Ask Claude a question about your data. Deletes and other destructive actions ask for confirmation first. Cursor picks up the forged .cursor/mcp.json automatically.
Chat UI
kiid-chat is a prebuilt React app that ships inside the CLI. It talks to a forged server, keeps conversations on the server and lets you browse and run read-only tools.
kiid-mcp ui --out ./kiid-chat --server http://localhost:5080
cd kiid-chat
npm install
npm run dev # http://localhost:5173| Tab | What to check |
|---|---|
| Chat | Answers stream in. Refresh the page and the conversation returns. Create, rename and delete sessions. |
| Tools | Every generated tool is listed; read-only ones run in place. |
| Dev | Server URL, optional Authorization header, optional OpenAI-compatible model, theme. |
Troubleshooting
| Symptom | Cause and fix |
|---|---|
kiid-mcp is not recognized | Stale terminal PATH. Restart VS Code or run the PATH refresh under Install the CLI. |
| Could not reach the generator service | The forge isn't running, or KIID_MCP_ENDPOINT isn't set in this terminal. |
405 on /mcp in a browser | Expected. /mcp is for MCP clients, which use POST. Use /docs in the browser. |
422 "The audit store is unavailable" | PostgreSQL is down. Start Docker, run docker compose up -d postgres, restart the server. |
401 / 403 from a tool | Upstream credentials missing or wrong. Set them with dotnet user-secrets. |
502 from a tool | The upstream API is down, unreachable, or its HTTPS certificate isn't trusted (dotnet dev-certs https --trust for local APIs). |
| Address already in use | Another app owns the port. Pass --urls http://localhost:<port>. |
Restore can't find ProjectKiid.Mcp.* | The package feed in the forged nuget.config isn't reachable or needs credentials. |
| kiid-chat network or CORS error | Add the UI's origin to Cors:AllowedOrigins in the forged server's settings. |
Updating the CLI
The installed tool is a snapshot. After changing CLI code, repeat Install the CLI; each pack needs a new version, because NuGet will not re-extract a version it has cached. Changes to templates or planning live in the forge service, so restarting the service is enough for those.
dotnet tool uninstall -g ProjectKiid.McpForge # remove it