An MCP server is a small program that offers functions to an AI model through a standard interface: read this record, list these invoices, create this task. MCP, the Model Context Protocol, is that interface. It is not the security. A company needs this work when an assistant has to answer from live data or act inside a system, and when the people responsible for that system must know which operations the model can perform, on whose behalf, and what it did.
What I build
- A server for one system. A database, a CRM or an internal API, exposed as specific tools with defined inputs, returned fields, pagination and behavior on failure.
- Remote gateways. A server on Cloud Run that cloud agents call over Streamable HTTP, with caller identity, secrets in Secret Manager and smoke tests. It can put many tools behind fewer, clearer entry points.
- Public servers. LeanManufacturing.mx has a server with no key and no token: Claude, ChatGPT, Cursor or Codex can query its documentation and calculate OEE.
- Open-source integrations. Airtable MCP lets an assistant such as Claude query an Airtable base in everyday language, installed through Smithery or the command line.
Questions to settle before a model touches your data
- Which operations, exactly? A list of named tools, reads first. A general SQL tool needs far stronger isolation than an instruction that asks the model to behave.
- Who is calling? The caller and the organization come from the authenticated context of the server, never from an identifier the model supplies.
- What can the account of the server do? A database identity with narrow grants, and row-level policies where they apply. Parameterized queries stop SQL injection, but they do not decide whether this caller may read that invoice.
- Where do the credentials live? In the secret store of the runtime, rotated and separate for each environment. Never in a prompt.
- What happens on a write? Schema validation, business rules and authorization before execution, and for consequential operations an approval bound to the exact operation and its arguments.
- What is recorded? For each call: a trace id, the tool and its version, the decision and the outcome.
How the work runs
- Inventory. I list the systems, the data in each one and the questions and actions the assistant should handle. A short list of tools comes out.
- Contracts for the read tools. Each tool gets a written contract: identity, authorization, result fields, limits on time, size and rate, and what the audit keeps.
- The refused cases. For each valid request I test its denied counterpart: another organization, an expired credential, a forbidden field, an oversized result, a database that is down. Retrieved text is treated as untrusted data.
- Writes, later and with approval. Changes arrive once the reads are trusted, with idempotency keys for retries and approvals that expire.
- Two transports. Local stdio for the machine of a developer, Streamable HTTP for the cloud. On Cloud Run the caller is identified by the platform and again by a bearer token in the application.
- Smoke tests and evidence. Smoke tests cover health, auth, initialize and the tool list, and the ledger of tool calls can be exported for review after a run.
What you receive
The server in your repository and your cloud project, with its container and pipeline files, the tool contracts, the permission model in writing, the denial tests, the smoke tests and the steps to register it with your assistants and agents. The credentials stay in your secret store.
What this does not include
An MCP server is not a security audit. I do not expose a general SQL tool on a production database because a prompt asks the model to be careful, and a second model call is not a permission check. If the database has no roles or policies that match your rules, that work comes first.
Where the evidence is
MetaMCP is my open-source gateway. Its case study covers the path to Cloud Run: both transports, the manifests for Agent Registry, a Google ADK sample, the smoke tests and the export of evidence. Airtable MCP is a public integration between a database and an assistant. LeanManufacturing.mx runs the public server described above. The cards on this page state where each one stops.