A protocol for one server that connects many services, and never lends the agent the keys
MICP is a protocol for an integration server: one server that holds connections to many services (Google, Microsoft, Stripe, Telegram, a spreadsheet, a mailbox) and performs calls on their behalf. Software agents are now asked to act on those systems: send mail, publish video, write rows into a spreadsheet. The usual way to grant that access is to hand the agent a credential (a token, a password, an API key) and to hope that the transcript stays private. In it, an agent never holds a credential. Integrations declare what exists; accounts hold the secrets, encrypted under a single vault key and enable the methods they may use; and every call is scoped and recorded. We separate what a protocol must specify from what an implementation may choose, and we show that the same rules serve an agent, a scheduled job and a back-end service without change.
Keywords: agent tooling, credential management, least privilege, declarative integration, audit
The centre of the picture is the integration server: one server that holds many integrations. An integration is a type of service, such as email, messaging or spreadsheets. Inside each integration there are accounts, one per connection, each with its own credential. And each account enables the methods it is allowed to use. One server, many integrations, several accounts per integration, a few methods per account.
Two roles sit around it. The client is the software that talks to the server: it asks what exists, and presents each method to the model as a tool. It may be a chat application, a workflow engine, an editor or a command line. The agent is the model inside that client, choosing among the methods and asking for an action. The protocol constrains what the server declares and how a call is authorised; it says nothing about who builds the client or in what language.
This paper describes the server that sits behind the agent: one integration server, holding the integrations an operator has installed, each with its accounts and the methods those accounts may use. It is not a library and not a framework. It is a place where credentials live and calls are decided.
An agent needs to send an email. The easy way is to paste an application password into the chat. It works. For about three weeks, nobody notices anything.
Then the account is used by someone else. Or the password is changed at the provider. Or a support ticket arrives with the whole conversation attached. The password now lives in four places: the chat, the provider's logs, the client's history, and whatever the user pasted it into. None of them is where it should be.
There is a second problem behind the first. A password is not a permission. A mail password that lets you send is also a key to read every message, delete folders and change settings. Saying send this email hands over much more than the sentence says. And because the password travels with the agent, nothing can check whether this one action was allowed.
Tool-calling protocols made this better. They move the password out of the chat and behind a tool. That fixes the first problem. The second stays: a tool is either visible to the model or it is not, and who may call what lives in the client, if it lives anywhere. The record of what happened is whatever the client chose to keep.
MICP describes the layer below. The unit that matters is not the integration but the method on a specific account. Passwords belong to a vault, not to a caller. Permission is data, not a property of a key.
Section 2 gives the model. Section 3 covers keys. Section 4 shows a call. Section 5 explains discovery. Section 6 describes how to build a client. Section 7 lists the conformance checks. Section 8 separates what is implemented from what is planned. Section 9 relates this layer to other tool-calling standards.
Three nouns, and one rule for each:
gmail, stripe or telegram. It declares the methods this service can perform and how a credential for it is
obtained.A method is declarative: an endpoint, a request template, an input schema and an optional output map. It contains no code. The executor is written once and interprets the declaration, which is why adding an integration is a configuration change rather than a deployment, and why a pack can be reviewed by reading it.
{
"micp": "0.2",
"integration": "email",
"description": "Send email from a mailbox.",
"defaults": {
"smtp_host": "smtp.gmail.com",
"smtp_port": 465,
"tls": "implicit"
},
"accounts": [
{ "account": "elizeu",
"config": { "email": "[email protected]" },
"custom": { "assinatura": "Elizeu Carlos" },
"secrets": { "app_password": "{{vault:email.elizeu.app_password}}" } },
{ "account": "suporte",
"config": { "email": "[email protected]", "smtp_port": 587, "tls": "starttls" },
"custom": { "assinatura": "Equipa de suporte" },
"secrets": { "app_password": "{{vault:email.suporte.app_password}}" } }
],
"methods": {
"send": {
"description": "Send an email from the selected account.",
"transport": "smtp",
"endpoint": {
"host": "{{defaults.smtp_host}}",
"port": "{{account.smtp_port | default:defaults.smtp_port}}",
"tls": "{{account.tls | default:defaults.tls}}"
},
"request": {
"auth": { "user": "{{account.email}}", "password": "{{secret.app_password}}" },
"from": "{{account.email}}",
"to": "{{input.to}}",
"subject": "{{input.subject}}",
"body": "{{input.body}}\n\n{{account.custom.assinatura}}"
},
"fields": {
"to": { "type": "email", "required": true },
"subject": { "type": "text", "required": true, "max": 200 },
"body": { "type": "text", "required": true }
},
"output": { "sent": "constant:true", "message_id": "smtp.message_id" }
}
},
"destinations": ["{{defaults.smtp_host}}"]
}
Configuration lives at three levels, and the method is written once for all of them. That is what makes a second account a row of data instead of a second integration.
| In the template | Source | Visible to |
|---|---|---|
| {{defaults.x}} | the integration defaults, shared by every account | everyone |
| {{account.x}} | a field of the account, in config | discovery, UI, logs |
| {{account.custom.x}} | a user-defined extra, in custom | discovery, UI, logs |
| {{secret.x}} | the vault, decrypted for the duration of the call | nobody |
| {{input.x}} | a field declared in fields and sent by the caller | the caller |
The rule for placing a value is one question: if this appeared in a screenshot or in the discovery response, would it grant access? If yes, it belongs in the vault. If no, it belongs to the account. Nothing else decides.
Two consequences follow. First, the account is a parameter of the method, never a free string: the caller picks from a list, so a model cannot invent a mailbox. Second, a secret is a reference, never a value: the pack can be shared, reviewed and kept in a repository.
MICP has two kinds of key, and they answer different questions. Provider keys belong to the services, and there are many. The vault key belongs to the installation, and there is one.
| Key | Count | Function | Leaves the server |
|---|---|---|---|
| Vault key | one per installation | encrypts and decrypts stored credentials | never |
| Account credential | one per account | what the provider issued | only on the outbound call |
| Access token | one per caller | who may call which method | to that caller |
The vault key is the only secret an operator has to keep, rotate and back up. It does not authenticate anyone and it does not grant anything: it opens a store. Permission is a property of the deployment, not of the key: what an account may do is decided
where the account is enabled, and the key only opens the store. It is a plain pair of keys: one private key that decrypts, one public key that encrypts. Two files, two lines of configuration, no special format: X25519 to agree a secret, AES-256-GCM to seal each value, and the record's address mixed into the authenticated data. Three commands cover its whole life: keygen, verify and rotate.
A credential is encrypted before it touches disk, with a random nonce per record and the record's address bound into the authenticated data: installation, integration, account, field. Copying a row into another account therefore fails to decrypt, which turns a database write into a non-event.
Rotation replaces the vault key without re-asking anyone for anything: a new key is generated alongside the old, new writes use it, a background pass re-encrypts the remaining rows, and the old key is retired when no row refers to it. Rotation bounds the damage of a key copied without the operator's knowledge; it does not stop an attack in progress, which is a matter for revocation.
A call carries a method, an account, the inputs, and a signature over the exact bytes. Two questions get two different answers, and mixing them produces systems that authenticate and never authorise.
The signature says whether the request is genuine and unchanged. It covers the body, a timestamp and a nonce, so a replay is visible and useless. What an account may do is decided when the account is enabled: a method that is not enabled is not announced. A request for one is a well-formed refusal.
POST /v1/call/email.elizeu.send
Authorization: Bearer <access token> # who is calling, and only that
Content-Type: application/json
{ "input": { "to": "[email protected]",
"subject": "Relatório",
"body": "Segue em anexo." } }
Errors are typed rather than free text: invalid input, vault unavailable, not authorised, provider failure, idempotency conflict. A caller can therefore react deterministically, and an operator can count failures by kind. Idempotency is keyed by the caller's request identifier and attempt, so a retry after a crash does not send the same email twice.
The call carries the method in its name. Three groups, always in this order:
integration.account.method. The body carries only the inputs.
POST /v1/call/email.elizeu.send
Content-Type: application/json
{ "input": { "to": "[email protected]",
"subject": "Relatório",
"body": "Segue em anexo." } }
What the integration server does with it, with the secret masked:
defaults.smtp_host smtp.gmail.com
account.smtp_port 465 (from defaults, no override)
account.email [email protected]
account.custom.assinatura Elizeu Carlos
secret.app_password ***
CONNECT smtp.gmail.com:465 implicit TLS
AUTH [email protected] ***
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
Subject: Relatório
Segue em anexo.
Elizeu Carlos
The same method, called on the other account, produces a different request with no change to the
pack: the second account overrides smtp_port and tls, and brings its own
signature and its own secret.
POST /v1/call/email.suporte.send
{ "input": { "to": "[email protected]", "subject": "Bilhete #4821", "body": "Em análise." } }
CONNECT smtp.gmail.com:587 STARTTLS ← override da conta
AUTH [email protected] ***
A third call, on a service that uses an HTTP API and a custom field, shows the same shape applied
elsewhere. Here the pack reads a destination from defaults, a channel from the account, a
tone from the user-defined extras, a token from the vault, and three fields from the caller.
POST /v1/call/telegram.canal_curso.send
{ "input": { "text": "Episódio 12 no ar", "silent": false } }
→ POST https://api.telegram.org/bot***/sendMessage
{ "chat_id": "-100123456", ← {{account.chat_id}}
"text": "Episódio 12 no ar", ← {{input.text}}
"parse_mode": "Markdown", ← {{account.custom.formato}}
"disable_notification": false } ← {{input.silent}}
Nothing in these three calls required a line of code per integration. What changed between them was data: an override here, a custom field there, a different transport in the third.
Describing the response is optional. If a method has no output, the provider's answer comes
back as it arrived. That is the default, and it is what you want while you are building the integration.
If the method declares output, only the listed fields come back, each with a type:
"output": {
"message_id": { "path": "body.id", "type": "text", "required": true },
"accepted": { "path": "smtp.accepted", "type": "list" }
}
output chooses and checks. It does not transform: no renaming, no date arithmetic, no
joins. If you need that, do it where you call, not inside the pack.
Two optional marks per field handle the two ways a response can disappoint you. default
covers a field that did not come: the server returns the default instead of failing. expected
covers a field that came with the wrong value: the call fails, because a response that says
ok: false is not a success even when the HTTP status is 200.
"output": {
"ok": { "path": "body.ok", "type": "boolean", "expected": true },
"chat": { "path": "body.chat", "type": "text", "default": "" }
}
When expected fails, the answer is a typed error, not a value the caller has to
interpret:
{ "ok": false, "error": "resposta_inesperada",
"campo": "ok", "esperado": true, "recebido": false,
"efeito_possivel": true, "tentavel": false }
efeito_possivel matters: the provider answered 200, so the action may have happened.
It is not an error to retry blindly; it is one to check first.
One exception is worth spelling out. A few services return a new credential in the response, a
refresh token being the usual case. If the answer carries a field whose name matches a secret already
stored for that account, the server stores it in the vault, encrypted, and returns
{"stored": true} in its place. The value never leaves the server. Most integrations never do
this, and for them it costs nothing. Large responses are cut at 64 KB.
A server that exports everything exports too much. Discovery answers only with what the server has enabled, and the filtering happens on the server, before the caller sees anything.
A method the caller cannot use is not refused later. It never appears. The difference is not cosmetic. A refusal tells the agent that something exists and invites a second attempt; invisibility leaves nothing to try. It also keeps prompts small, which is why most deployments end up doing this anyway.
Because the announcement contains no secrets (names, descriptions, schemas), it can be served freely, cached and shown in a user interface. It is a menu, not a key.
A caller asks the server what exists:
GET /v1/discovery
{ "micp": "0.2",
"integrations": [
{ "integration": "email",
"accounts": [
{ "account": "elizeu",
"methods": [
{ "name": "email.elizeu.send",
"description": "Send an email from the selected account.",
"input": { "to": {"type":"email","required":true},
"subject": {"type":"text","required":true,"max":200},
"body": {"type":"text","required":true} },
"output": { "sent": {"type":"boolean","expected":true},
"message_id": {"type":"text"} } },
{ "name": "email.elizeu.list", … }
] },
{ "account": "suporte", "methods": [ … ] }
] },
{ "integration": "telegram",
"accounts": [ { "account": "canal_curso", "methods": [ … ] } ] }
] }
Three levels, in the order a person thinks about them: the integration, the accounts inside it,
and the methods each account may use. A method carries four keys: name,
description, input and output.
The name is repeated at every level on purpose. It could be assembled from the three
parts, but a caller that has to concatenate strings eventually concatenates them wrong. Given the name,
it copies it.
There are no paths, no headers, no transport and no endpoint in this response: those belong to the pack and never leave the server. The list contains only what is installed and enabled. A credential grants access to the server; how a deployment organises tenants, roles and interface is left to the implementation.
The same data can be rendered as a compact block for a prompt, with ?target=text. Any other
value is refused with alvo_invalido, so a typo surfaces on the first attempt instead of in a
client three weeks later.
A model does not need a protocol to get tools. It needs a name, a description and a JSON schema. Whoever builds that list is the client, and building it is the work this section describes.
POST
/v1/call/{integration}.{account}.{method} with the inputs, verify the result and return the
mapped output.packs/<integration>.micp.json and reload: nothing else to build, nothing to
deploy.An integration is a file, not a program. The pack says what the methods are; the server reads it and does the work. There is no build step, no package to install and no code to review line by line: you read the file, and you know what the integration can do.
To make that concrete, there is a builder at micpprotocol.com/builder.html. Four steps: the integration and its defaults, the accounts, the methods, and the JSON. It shows the request that will be sent, with the secret masked, and gives you the file to drop on your server. Instructions for connecting an agent are on the Agent page.
What it will not do is the interesting part. There are no conditions, no loops, no expressions and no code inside a pack. If a service needs logic to be called, it needs a new transport or it waits. A refusal is easier to audit than a language.
Announcing everything is simpler to build and easier for a model to use. It also costs context on every call. That is a product decision, not a protocol one, and it can be changed per account, which is why enablement belongs to whoever operates the server.
An implementation conforms to MICP v0.2 if it satisfies the following. The list is deliberately short: every item can be checked by reading a pack or by issuing a request.
The reference implementation meets ten of these twelve. Items 8 and 9 are specified and not yet built; they are listed here because the protocol requires them, and because a reader deserves to know which promises are still open.
{{vault:integration.account.field}}.This document describes a protocol that is partly implemented. The difference matters, so it is stated rather than implied.
| Element | State | Note |
|---|---|---|
| Declarative methods | implemented | transports http, smtp, imap |
| Accounts as data | implemented | methods enabled per account |
| Grants per method | not in 0.2 | one access level per server; scoping is left to the implementation |
| Filtered discovery | implemented | only installed and enabled methods appear |
| Audit of calls | implemented | account, method, caller, outcome |
| Vault, X25519 and AES-256-GCM | implemented | keygen, verify and rotate; one key per installation |
| Discovery endpoint | implemented | GET /v1/discovery, JSON and text |
| Idempotency per request | not in 0.2 | a retry after a crash can repeat a call |
| Signed calls with nonce | in progress | scoped tokens shipped; body signature next |
The protocol is specified carefully because the failure is expensive: a password handed to an agent cannot be taken back. A feature written down but not built is a promise; a feature built but not written down is a rumour. The table keeps both visible.
Nothing in this protocol assumes a model. A nightly job that publishes a report, a back end that sends an invoice when an order ships, a command line a person uses by hand: each of them is a caller, and each is authorized and recorded in the same way.
The agent case is what forced the design, because an agent can invent a call and a model cannot be trusted with a key. But the rules it produced are not agent rules. A deterministic program that knows exactly which method it wants benefits from the same three properties: the secret stays in the vault, the method is declared rather than coded, and the call leaves a record.
A caller needs two things: the server's address and a credential. It does not need a model, a
framework, or an SDK. That is why the protocol is specified as HTTP and JSON: a cron entry with
curl is a first-class caller, and so is a compiler with a generated client.
The same holds for the other direction. A deployment that already has its own scheduler does not have
to adapt to an agent framework to use this: it calls POST /v1/call/{integration}.{account}.{method}
and reads {ok, output}. Whether a model, a queue worker or a person asked for it is a detail
the server records and does not need to know.