Skip to content
MCP Tunnel and Resources

MCP Tunnel and Resources

Overview

Partite Mesh uses standard MCP. It adds two things:

  • A Tunnel transport. An MCP server does not need a public address.
  • Conventions for resources. Tools give the agent references instead of whole results.

Tunnel

Why

  • You do not open inbound firewall holes or set up load balancers.
  • You can run a server on a laptop and connect it to a cloud mesh.
  • To scale, run more relays.
  • If a call is made while no relay is attached, the call waits in a queue. It does not fail.

Concepts

TermMeaning
ConnectionAn MCP Connection that uses the Tunnel transport. You attach it to agents like any MCP connection.
SubscriptionA named set of tag criteria. Relays attach to one subscription.
Tunnel keyA credential for one subscription. Partite shows it once. It can expire. You can revoke it.
RelayA process that you run. It connects out to Partite, receives tool calls and forwards them to your MCP server.
Conversation tagsThe tags set when the conversation starts. A subscription serves the conversations whose tags match all of its criteria.

Setting it up

  1. Create an MCP connection with Transport set to Tunnel.
  2. Keep the default subscription, which matches every conversation. Or add a subscription with criteria.
  3. Under Keys, select New key. Copy the credential.
  4. Run partite-mcp-relay where your MCP server runs. Put the credential in PARTITE_RELAY_TOKEN. The relay launches your MCP server as a local process, the same way an MCP client on the same machine does. The relay reaches the mesh over an outbound connection.
  5. Open the Relays list of the subscription. It shows the relay as attached, with its tools.
  6. Attach the connection to an agent.

Routing with subscriptions

A connection can have more than one subscription. For example:

SubscriptionCriteria
Productionenv=prod
Bob's laptopenv=dev and developer=bob

If you create a conversation with the tags env=dev and developer=bob, Bob’s relay serves it. If you create a conversation with env=prod, the production relay serves it.

Use this for:

  • per-developer debugging
  • per-tenant deployments
  • staged rollouts

Keys and rotation

To rotate a key, create a second key and deploy it. Then revoke the first key.

Set an expiry for keys that you give to CI. The connection page shows when each key was last used.

Resources

What a resource is

A resource is a reference that a tool returns instead of a result. Examples:

  • a document to search instead of read whole
  • a query to narrow before reading
  • a session to act on

A tool returns a resource as an MCP resource_link or as an embedded resource. The mimeType says what the resource is, for example text/vnd.example.person for a person that reads as text, or application/vnd.example.person+json for one that reads as JSON.

{
  "type": "resource_link",
  "uri": "person://1",
  "name": "Ada",
  "description": "A person. Read their name, or echo a message to them.",
  "mimeType": "text/vnd.example.person"
}

Handles

The agent never sees the URI. Each resource gets a handle in the order it arrives: r1, r2, r3. A handle is valid only in its conversation.

The agent passes handles to tools. The agent also cites handles in grounded fields.

Tools that take resources

A tool declares in _meta which parameters take resources, and of which media types.

{
  "name": "get_name",
  "description": "Get the name of a person",
  "inputSchema": {
    "type": "object",
    "properties": {
      "person": { "type": "string", "description": "The person to read" }
    },
    "required": ["person"]
  },
  "_meta": {
    "com.partite/resources": {
      "person": "text/vnd.example.person"
    }
  }
}

These rules apply:

  • Only top-level string properties can take resources.
  • A value is one media type or a list of media types.
  • image/* matches any image. */* matches any resource.
  • The agent sees the tool only after the conversation holds a matching resource. After that, the tool stays visible for the conversation.
  • You can pass a resource to a tool on any connection that takes its media type.

Reading

The agent reads a resource with its built-in read tool. Give every linked resource a useful read where one exists.

Files attached to a conversation are resources too. You cannot pass them to server tools.

Why this helps

  • Tokens: the agent does not load large data into the context.
  • Focus: the agent explores large data step by step.
  • Provenance: final answers cite resource fields.

Related