Skip to content

Integration: Custom MCP Client

This guide is scoped to Coder 0.6.32. Its configured MCP URL is http://127.0.0.1:8000/mcp/, using HTTP MCP. A client must support that transport and be able to reach the process on your computer. This is separate from the provider harness on port 8080.

  1. Install and activate Coder using the current install selector.
  2. Register your repository through Coder’s project setup. Check memstrata-coder project list --json.
  3. Check memstrata-coder doctor. If the API is not running, start memstrata-coder api --port 8000; do not duplicate a service already started by Setup.
  4. Add the HTTP MCP URL to your client using its supported configuration format.
  5. Initialize the MCP connection and discover tools/list. Call list_code_projects, then get_code_context with a returned project ID.

The URL is loopback-only. In a remote IDE or container, 127.0.0.1 refers to that environment, not necessarily your desktop. Do not expose the service publicly to work around a connection problem.

A successful get_code_context result can record context-delivery telemetry. It does not prove that a model consumed the pack, that every coding turn called the tool, or that provider requests passed through the harness.

The four code-context tools and their scope are documented in the API reference. Discover the installed schemas; the old context_query, index_status, savings_summary and memstrata mcp --stdio examples are not this release’s contract.

remember_verified_code_fact writes to a local ledger. Do not enable or invoke write tools without intending that change.

  • No tools: verify that the API service, not only the harness, is running. Check the client’s MCP connection log and the installed tool list.
  • project_required: choose a project ID returned by list_code_projects.
  • not_indexed or empty context: wait for the registered project to finish indexing. Do not treat the empty result as evidence that the repository contains nothing relevant.
  • Remote client cannot connect: confirm where the client and service run. Loopback addresses are machine-local.
  • Savings absent: context retrieval and provider routing are separate. See Telemetry and savings; neither a green connection icon nor a successful tool listing proves paid savings.

Use the MCP SDK or your host’s supported client rather than a hand-written one-line JSON-RPC example that skips initialization, notifications, or transport framing.