← Back to blog

Pegas field notes · October 2026

Pegas Became an MCP Server: Other Agents Get a Tool, Not Authority

How Pegas opened itself to external AI agents through the Model Context Protocol, and why the caller gets a tool but never payment authority.

Until now, Pegas had one kind of user: a person on the website.

A person types a request. Pegas runs its own open model, passes the request through Intake, Privacy, Routing and Review, and in the paid scenario buys one Legal consultation for 0.01 test USDC on Solana Devnet. Every step is visible, and every payment has evidence.

But the world we are building for is not only people clicking buttons. More and more work will start with one AI agent asking another one for help. So we asked a simple question:

What happens when the caller is not a person, but another agent?

The answer is the newest part of Pegas: an MCP server.

Why MCP

MCP (Model Context Protocol) is an open standard for connecting AI assistants to external tools and services. If a service speaks MCP, an assistant like Claude can discover what it offers and call it, without custom integration work.

We had two options:

  1. MCP inside Pegas. Our own agents call external tools through MCP.
  2. Pegas as an MCP server. External agents call Pegas.

We chose the second one. The first option would be mostly invisible, and a 4-billion-parameter model is not great at choosing between many tools. The second option completes the picture Pegas was built to show:

own model         → Qwen3 4B on Modal, scale to zero
agents            → Intake, Privacy, Routing, Legal Advisor, Reviewer
payment           → x402 on Solana Devnet
governance        → mandate, KYA-lite, AUTH-01..AUTH-10
connection        → MCP: other agents can now call Pegastext

Three tools, nothing more

Pegas exposes exactly three tools at /api/mcp:

  • submit_request: Runs the free standard workflow and returns a routed request card. Spends: no.
  • request_legal_consultation: Runs the paid workflow. If Routing selects Legal, Pegas buys one consultation. Spends: 0.01 test USDC.
  • get_payment_evidence: Returns the stored mandate, policy checks and settlement evidence. Spends: no.

We kept the list short on purpose. Every extra tool is something an external agent can misuse or misunderstand.

The main idea: a tool is not authority

This is the part that matters most.

When Claude calls request_legal_consultation, Claude does not get the right to pay. Claude has no keys. Claude does not sign anything. Claude cannot change the price, the seller, the network, the token or the number of payments.

Claude can only ask. Pegas then runs exactly the same checks it runs for a person on the website:

External agent (self-declared, not verified)
  → Pegas Routing Agent (registered, KYA-lite)
    → Legal Advisor (registered seller)text

Each link in this chain can only narrow authority, never expand it. The external agent sits at the start of the chain, and it has the least authority of all.

We also made the record honest. The mandate now stores who started the operation. When a request comes from the website, the principal is pegas-request-desk. When it comes through MCP, the principal is:

mcp-external-agent — External agent via MCP (identity not verified)text

This value lives inside the mandate fingerprint and inside the public payment evidence. Anyone who reads the evidence later can see that the purchase was requested by an unverified external agent and paid under Pegas' own bounded mandate.

One shared lane for strangers

On the website, payment limits are counted per browser session. External agents have no browser session, and we cannot verify who they are. So all MCP callers share one budget lane: the same per-session and per-hour limits, but applied to all external agents together, inside the global daily budget.

This is a small decision, but it follows the same principle. An unknown caller should get a narrower lane, not a wider one.

First real test: Claude found a bug in our answer

We connected Pegas to Claude as a custom connector and sent a simple technical request: our API returns 500 errors on the /orders endpoint.

Pegas routed it to the technical team with high priority. Then Claude added something we did not expect. It noticed that our summary said "50:00 errors" instead of "500 errors".

The cause was the small model. Qwen3 4B rewrote the number while paraphrasing. We fixed it with one rule in the agent prompts: copy numbers, error codes, paths and amounts exactly.

But the moment itself is worth noting. The external agent did not just pass our answer along. It checked it. Agents controlling each other is a better pattern than agents blindly trusting each other.

Second real test: the paid path failed, and that was useful

The first paid requests through MCP failed. Nothing was spent, and the payment step was never reached.

We ran the same request through the website and saw the real reason. The Routing agent quotes short pieces of the request as evidence for its decision. In paid mode, after Privacy, Routing only sees a reduced safe summary, not the original text. The model quoted phrases from the original request. A strict check rejected them, the repair attempt failed the same way, and the workflow stopped.

The standard flow had solved this long ago: quotes that do not match are dropped, and the workflow continues. The paid flow still had the older, stricter rule. We aligned them. Only exact pieces of the allowed text still reach the next agents, so the privacy guarantee did not change.

MCP did not cause this bug. It helped us find it, because a new kind of caller sent requests in a slightly different way.

After the fix, the full paid path worked through MCP:

Intake → Routing selects Legal → mandate created → KYA-lite checked
→ 402 quote frozen → AUTH 10/10 → payment signed by Pegas
→ settled → confirmed on Solana Devnet (Alchemy evidence)
→ mandate consumed → Legal Advisor → Reviewertext

The external agent then called get_payment_evidence and saw principal_id: mcp-external-agent in the stored evidence.

Making it visible on the website

A connector in Claude settings is great for developers, but most visitors will never add one. So the Demo page now has a second switch: Web form or AI agent via MCP.

In agent mode, a small MCP client runs in your browser and plays the external agent. It speaks real JSON-RPC to the same public /api/mcp endpoint:

initialize → tools/list → tools/call (with live progress) → get_payment_evidencetext

On the left you see the conversation between the agent and Pegas. On the right you see what Pegas does inside: the agent graph, the payment timeline and the evidence. Progress arrives step by step while the work happens, not at the end.

Progress messages carry only public step information: step number, type and agent name. Internal payloads and handoff context never leave the server.

What this does not prove

Pegas is still a demo:

  • payments use test USDC on Solana Devnet, not real money;
  • the external agent's identity is self-declared and not verified;
  • the MCP endpoint has no sign-in, so anyone can call it within the public limits;
  • the Legal Advisor applies a small demo policy, not real legal advice.

Real systems would need verified agent identity, signed client metadata, per-client mandates and much stronger key management. MCP's own authorization model is moving in that direction, and Pegas is a good place to try it next.

The point

Connecting an agent to a payment API is easy. The hard part is deciding what the caller is allowed to do, and proving afterward what actually happened.

With MCP, Pegas now shows this across a real boundary between agents. Another agent can hire Pegas. It cannot take Pegas' authority. And the evidence says so.