Skip to content

Latest commit

 

History

History
127 lines (100 loc) · 4.39 KB

MCP.md

File metadata and controls

127 lines (100 loc) · 4.39 KB
spec_name MCP.md
spec_version 0.1.0
category Technical
priority High
volume Vol 2 — Extended Operations
maintained_by TotalMarkdown.ai
license CC0 1.0 Universal
tier core
status draft
spec_type static

MCP.md

Category: Technical Priority: High Version: 0.1.0 Type: Static

Purpose

Documents all MCP (Model Context Protocol) server connections for an agent — what servers it connects to, what tools are available from each, authentication methods, and usage guidelines. The definitive reference for an agent's external tool access.

When to create

Any agent that uses MCP servers to access external tools, data sources, APIs, or services. Required for agents with more than 2 MCP connections.

Spec

---
agent_name: string
version: semver
mcp_client_version: string   # MCP protocol version
total_servers: number
total_tools: number
created: date
updated: date
---

# [Agent Name] — MCP Server Configuration

## Overview
This agent connects to [N] MCP servers providing [N] tools total.
All connections use MCP protocol version [X].

## Server Registry

### [Server Name]
- **URL/Transport:** [stdio | sse | http] — [endpoint if network]
- **Purpose:** [What this server provides in one sentence]
- **Auth method:** [none | API key | OAuth | token]
- **Credential location:** [env var name | keychain key]
- **Connection mode:** [always-on | on-demand | lazy]
- **Approved tools from this server:**

| Tool | Purpose | When to use | Rate limit |
|------|---------|-------------|-----------|
| [tool_name] | [description] | [trigger conditions] | [limit] |

- **Prohibited operations:** [any tools NOT to use from this server]
- **Fallback if unavailable:** [what to do if server is down]

[Repeat for each server]

## Tool Selection Guidelines
See TOOLS.md for the full tool inventory and approval status.
When multiple tools could accomplish a task, prefer:
1. Most specific tool (narrowest scope)
2. Read-only over read-write
3. Local over remote (prefer tools that don't make external calls)
4. Cheaper over expensive (token/cost consideration)

## Tool Call Limits
| Time period | Max tool calls | Max per server | Notes |
|-------------|---------------|----------------|-------|
| Per task | [N] | [N] | Hard limit |
| Per hour | [N] | [N] | |
| Per day | [N] | [N] | Reset at midnight UTC |

## Error Handling for MCP Calls
- Timeout: [X seconds] per tool call
- On timeout: [retry once | skip | escalate]
- On error: log, retry [N] times with [backoff], then skip or escalate
- On rate limit: wait [X seconds], retry — do not hammer

## Security Rules
- Never pass credentials as tool arguments
- Never call tools not listed in this file
- Log all tool calls with: tool name, inputs (sanitized), output summary
- If tool returns unexpected data format: stop, escalate, do not parse blindly

## Lazy Loading
To prevent context window pollution from tool schemas:
- Load tool schemas only when needed for current task
- Use Tool Search Tool pattern if available
- Defer loading of [list of verbose servers] until explicitly needed

Example Use Cases

Enterprise: A data engineering team uses MCP.md to document their ETL agent's connections to 8 MCP servers (GitHub, Slack, PostgreSQL, BigQuery, S3, Jira, PagerDuty, Confluence), with tool selection guidelines that prefer read-only operations and per-server rate limits.

Multi-Agent Fleet: A fleet security team audits MCP.md files across all agents to verify no agent connects to unauthorized MCP servers, enforcing a centralized allowlist and catching a rogue debugging server that was left connected in production.

Regulated Industry: A government contractor uses MCP.md to restrict its document processing agent to only three approved MCP servers (internal file server, classification service, redaction tool), with lazy loading to prevent classified tool schemas from polluting the context window.

Related Specs

Spec Relationship
API.md HTTP API specification
ATTESTATION.md Identity verification and credential lifecycle
CLI.md Command-line interface contract
INPUT.md Accepted input formats
OUTPUT.md Output formats and delivery
PERMISSIONS.md Static resource access control
TOOLS.md Available tools and capabilities

Part of agent-md-specs Maintained by TotalMarkdown.ai · License: CC0 1.0 Universal