Model Context Protocol
Configuration mechanics (scopes, .mcp.json, env expansion, commands) are in mcp server integration. This note is the architect's view.
What MCP gives you (design guidance)
A standard way to expose tools, resources and prompts from a system to any MCP-capable client, so integrations are written once instead of per client. Transports: http (recommended for remote), stdio (local process), sse (deprecated), ws (verified).
Topology choices
| Choice | Guidance |
|---|---|
| Build vs adopt | Adopt an existing vendor or community server for standard SaaS; build for internal systems or when you need control over tool design and output size |
| Local vs remote | stdio for developer-local tools; remote http (with OAuth) for shared, centrally operated services |
| Granularity | Few, well-described tools per server; consolidate related operations (2.1) |
| Scope | Project scope for team-shared servers; user scope for personal; managed for organisation policy |
Governance controls
- Managed settings can allowlist servers (
allowedMcpServers, restriction allowlists taken whole from the highest-ranked source), deny them (deniedMcpServersmerges from all sources) and restrict to managed-only servers (allowManagedMcpServersOnly); a managed MCP configuration file exists for organisation-wide servers. - Project
.mcp.jsonservers prompt for approval in interactive sessions but load without a prompt inclaude -p, the Agent SDK and cloud sessions; block explicitly withdisabledMcpjsonServersor--strict-mcp-config. - Scope precedence (local, project, user, plugin, connectors): the winning entry is used whole.
Context cost and scale
- Tool output limits: warning at 10,000 tokens, default maximum 25,000 (
MAX_MCP_OUTPUT_TOKENS); long text results are saved to a file. - Tool search (on by default in Claude Code) loads tool definitions lazily so many servers do not bloat context (D3.5).
- Timeouts:
MCP_TIMEOUT(startup),MCP_TOOL_TIMEOUT.
Security considerations (design guidance, with verified hooks)
- Tool output is untrusted input: a server that returns web pages, tickets or documents can carry prompt injection. Constrain what the agent can do after reading such output (D5.3).
- Supply chain: a third-party server runs with whatever access you grant; review, pin and allowlist.
- Least privilege: scoped tokens, read-only where possible;
${VAR}expansion keeps secrets out of committed.mcp.json(verified). - Authentication: remote servers use OAuth (
/mcporclaude mcp login); headless runs cannot complete OAuth, so authenticate interactively first (verified). - Hook matchers and permission rules address MCP tools as
mcp__<server>__<tool>(verified).
When not to use MCP (design guidance)
A single in-process function the model needs in one app may not justify a server; use a direct tool definition. MCP pays off when several clients or teams share the integration.
Exam traps
- Adding every available server, bloating context and expanding attack surface.
- Committing credentials in
.mcp.json. - Assuming CI prompts for project-server approval.
- Trusting server output as instructions.
- No allowlist for an organisation.
References
- MCP in Claude Code — checked Oct 16, 2026
- Managed settings — checked Oct 16, 2026
- Securely deploying AI agents — checked Oct 16, 2026
Check your understanding
How does an organisation restrict which MCP servers developers can use?Show answerHide answer
Answer
Managed settings allowlists and denylists (and a managed MCP configuration).A server returns scraped web content. Key risk?Show answerHide answer
Answer
Indirect prompt injection; limit what the agent may do afterwards.Which transport for a shared remote service?Show answerHide answer
Answer
http (OAuth), not deprecated sse.