Make an existing service usable by AI agents
Expose a small, useful part of your service through MCP. Start with two read-only tools, not a copy of your entire backend.
The result
A person asks an assistant to find an item in your service. The assistant lists relevant items, reads the selected one, and answers using the returned record. Your existing service still owns its data, permissions and business rules.
The example is a synthetic exhibition catalog with two tools: list_items and get_item. It is deliberately small enough to inspect. This is not an export of Naturate's backend or operating playbook.
Use this when
You have an existing service and a specific task an agent should perform through it. Skip MCP when an ordinary API client already does the job and no MCP host needs the integration. Do not begin by exposing every endpoint, SQL access or a generic command executor.
Try the example
Download catalog.mjs and server.mjs into a new directory. The former is the service logic; the latter is the MCP adapter. In that directory:
npm init -y
npm install @modelcontextprotocol/server zod
node server.mjsThe server listens on stdio; silence on startup is expected. Connect it from a local MCP client using the absolute path to server.mjs. The adapter follows the current official server quickstart. Record the installed package versions and retain the generated lockfile when testing. SDK installation and a real host walkthrough have not yet been verified for this guide.
Ask: “List the catalog items, then read the pond exhibition. Do not modify anything.” The expected records are synthetic. get_item for exhibit-999 returns not_found; a malformed ID is rejected.
Adapt the pattern
1. Name one user task. “Read a published exhibition” is a useful scope. “Give agents our database” is not. Specify the allowed input, selected output fields, failure result and permission required for each operation.
2. Keep the adapter thin. Replace the synthetic functions with calls to your existing service layer. Reuse its authorization and validation. The model never supplies its own identity or tenant authority.
3. Return enough information to finish the task. Include stable IDs and small, structured results. Distinguish missing records, denied access and temporary failures without leaking the existence of another tenant's private records.
4. Separate reads from changes. The sample cannot write. A later write tool should create a reviewable proposal first. It must not gain arbitrary backend capabilities because an assistant can request them.
5. Test the real client. Validate tool discovery, selection, argument handling, result rendering and recovery. Local stdio, hosted MCP and an API model are different integration tests. MCP tool annotations describe behaviour; they are not authorization controls.
Before hosting it
A remote production version needs authentication, tenant-scoped authorization, rate limits, timeouts, safe error handling and a log policy that excludes secrets. Treat returned record text as data, not instructions. Do not expose this local demonstration to the internet as an authenticated production service.
OpenAI's MCP integration guide and Anthropic's MCP connector guide describe their respective API integrations. Test and document each host separately.
What running a public one taught us
The example above is synthetic. These points come from operating a public, read-only MCP server that other people's agents call.
Write the tool description for the model. It is the only documentation the calling model reads. Say when to call the tool, what each input means, and what an empty or unresolved answer means. Most wrong calls trace back to a vague description.
Offer one broad tool and one narrow one. A general "get the facts for this place" tool, and a second that answers the single question people ask most. The narrow tool saves the model from assembling the answer itself and getting it wrong.
Put a version on the response. Name the schema and its version in every payload. A consumer can check the family before trusting the shape, and you can change a field without breaking anyone silently.
Return an explicit "unresolved" with a reason. A null tells the model nothing, and it will fill the gap. "Unresolved, provider timed out" gives it something true to say.
Serve every client from one endpoint. Hosts that speak remote MCP use the URL. Hosts that only speak stdio get a thin wrapper over the same API. A second backend for one host will drift.
Keep runnable examples, and run them on a schedule. A handful of small scripts that call the hosted server and assert they got a real answer. Run them on every change and once a day. A server that stops answering then shows up as a failed build, before a stranger meets it.
Prove the check can fail. Point the same runner at a stub that returns nothing and confirm it goes red. A check that cannot fail is reporting safety it never verified.
Check the package against the server. The package people install and the server it talks to are two things that can drift apart. Compare their tool list and input schema in CI.
Licensed upstream data needs the caller's own key. Accept it as a header, never log it, and leave that part of the answer empty when it is absent.
Say what is not done. If you are not yet listed in a registry, write that. A link that leads nowhere costs more trust than the sentence.
Evidence and maintenance
Offline tests cover the bounded catalog list, selected public fields, invalid IDs and missing records. They do not establish MCP transport compatibility or production security. Run the host smoke test after SDK or host changes, and repeat the permission tests when the real service is connected.
Agent implementation instructions. No ZIP or one-command skill installation is claimed yet.
Choose a useful job for AI
Practical implementation patterns and draft guides by Naturate. Start with a problem, then inspect the example and its limitations.
Get Claude and ChatGPT working on the same task
Let one assistant produce an artifact and another review it. Share the result and its evidence, not an endless conversation.