Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/sbroenne/mcp-server-excel/architecture-patternsgit clone --depth 1 https://github.com/sbroenne/mcp-server-excelWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/sbroenne/mcp-server-excel/architecture-patterns)<a href="https://agentmods.dev/instructions/sbroenne/mcp-server-excel/architecture-patterns"><img src="https://agentmods.dev/badge/instructions/sbroenne/mcp-server-excel/architecture-patterns.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00649 | $0.00649 |
| Opus 5 | $0.00324 | $0.00324 |
| Sonnet 5 | $0.00130 | $0.00130 |
| Haiku 4.5 | $0.00065 | $0.00065 |
Grade A, and why
mcp-server-excel architecture-patterns.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Architecture patterns
Layer boundaries
MCP Server -> in-process ExcelMcpService -> Core commands -> Excel COM
CLI -> named-pipe daemon -> ExcelMcpService -> Core commands -> Excel COM
ExcelMcp.ComInteropowns STA execution, COM lifetime, sessions, and shutdown.ExcelMcp.Coreowns Excel behavior and typed result models.ExcelMcp.Serviceowns transport-neutral command dispatch.- CLI and MCP are adapters. They must not reimplement Excel behavior.
- Source generators derive Service, CLI, and MCP routing from annotated Core interfaces. Change the source contract, not generated output.
Core command pattern
Core methods are synchronous and accept IExcelBatch. Validate ordinary .NET
arguments before entering the batch, then perform Excel work inside
batch.Execute.
public OperationResult Rename(IExcelBatch batch, string oldName, string newName)
{
ArgumentException.ThrowIfNullOrWhiteSpace(oldName);
ArgumentException.ThrowIfNullOrWhiteSpace(newName);
return batch.Execute((ctx, ct) =>
{
Excel.Worksheet? sheet = null;
try
{
ct.ThrowIfCancellationRequested();
sheet = ComUtilities.FindSheet(ctx.Book, oldName)
?? throw new InvalidOperationException(
$"Worksheet '{oldName}' was not found.");
sheet.Name = newName;
return new OperationResult { Success = true };
}
finally
{
ComUtilities.Release(ref sheet);
}
});
}
- Do not wrap
batch.Executein a broad catch that returns another result. - Acquire and release COM references inside the batch callback.
- Use cancellation checks in loops and before expensive operations.
- Reuse
ComUtilitiesand feature helpers before adding new interop logic.
Surface parity
For an action, parameter, default, or response change, trace this chain:
- Core
[ServiceCategory]interface and implementation - Generated Service command and argument model
- CLI generated command/options and daemon routing
- MCP action enum, mapping, schema, and generated/manual route
- CLI, MCP, and Core tests
skills/shared, feature docs, and help text
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 87 lines · 649 tokens per session scan A 892021c12bbf
mcp-server-excel architecture-patterns.instructions.md is an instructions file published in the GitHub repository sbroenne/mcp-server-excel (645 stars, last pushed 4d ago), licensed MIT. It adds 649 tokens to every session, about $0.0032 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
excel_mcp_server AGENTS.md
AGENTS.md instructions for urjeetpatel/excel_mcp_server, covering agents.md and agent documentation and test policy.
excel-mcp CLAUDE.md
Claude Code instructions for ASH1998/excel-mcp, covering claude.md, project overview, architecture, current implementation status and ✅ completed: file operations (phase 1).
apple-health-mcp AGENTS.md
Instructions for neiltron/apple-health-mcp, covering repository guidance, project, validate changes, code map and invariants.
open-sheet AGENTS.md
Instructions for lianghsun/open-sheet, covering open-sheet — repository guide, repo layout, commands, the one invariant and core pipeline.
mcp-ms-office-documents AGENTS.md
Instructions for ForLegalAI/mcp-ms-office-documents, covering agents.md, project overview, architecture, key conventions and filename generation.
bilig bilig-workpaper.instructions.md
Instructions for proompteng/bilig, covering bilig workpaper formula proof, first checks, required readback, command safety and references.