nexus: Agent for Claude Code

.claude/agents/mcp-crate-engineer.md

mcp-crate-engineer is an agent for Claude Code from Nexus-Router/nexus. It costs 288 tokens per session (833 once invoked), scanned A, original, MPL-2.0.

A coding agent for the Rust code in the `crates/mcp` directory, which handles the Model Context Protocol (MCP)—a standard way for AI systems to find and use tools.

In plain words
What is it for?
Use it when adding or changing MCP routing, tool search, tool indexing, authentication flows, or tool execution code.
Why use it?
It keeps changes to tool discovery, search, and execution routing consistent with the project's design and coding rules.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is Nexus-Router/nexus's own configuration. It tells Claude Code how to work on nexus itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything nexus configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Nexus-Router/nexus. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Nexus-Router/nexus/main/.claude/agents/mcp-crate-engineer.md
Clone the repo
git clone --depth 1 https://github.com/Nexus-Router/nexus

Made for: Claude Code.

Wrote 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.

agentmods badge for mcp-crate-engineer

README.md
[![agentmods](https://agentmods.dev/badge/agents/nexus-router/nexus/mcp-crate-engineer/github.svg)](https://agentmods.dev/agents/nexus-router/nexus/mcp-crate-engineer)
Your own site
<a href="https://agentmods.dev/agents/nexus-router/nexus/mcp-crate-engineer"><img src="https://agentmods.dev/badge/agents/nexus-router/nexus/mcp-crate-engineer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-crate-engineer

Your own site · 80×15
<a href="https://agentmods.dev/agents/nexus-router/nexus/mcp-crate-engineer"><img src="https://agentmods.dev/badge/agents/nexus-router/nexus/mcp-crate-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 288 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 833 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00288 $0.00833
Opus 5.5 $0.00115 $0.00333
Sonnet 5.5 $0.00058 $0.00167
Haiku 4.5 $0.00029 $0.00083

Measured 2mo ago against content hash 2d69cef2ad45, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-crate-engineer 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 2mo 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.

.claude/agents/mcp-crate-engineer.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.


name: mcp-crate-engineer description: Use this agent when editing any files within the crates/mcp directory. This includes modifications to the MCP router implementation, tool discovery, search functionality, or execution routing. The agent should be automatically triggered for any file changes in this directory to ensure compliance with project standards and MCP-specific patterns.\n\nExamples:\n\nContext: User is modifying a file in the crates/mcp directory\nuser: "Please add a new method to handle tool caching in the MCP router"\nassistant: "I'll add the tool caching method to the MCP router. Let me use the mcp-crate-engineer agent since we're working in the crates/mcp directory."\n\nSince the user is asking to modify code in the MCP crate, use the mcp-crate-engineer agent to ensure proper implementation following MCP patterns and project standards.\n\n\n\nContext: User is working on search functionality\nuser: "Update the Tantivy search implementation to support fuzzy matching"\nassistant: "I'll update the search implementation. Since this involves modifying files in crates/mcp, I'll use the mcp-crate-engineer agent."\n\nThe Tantivy search implementation is part of the MCP crate, so the mcp-crate-engineer agent should handle this modification.\n\n model: inherit

You are an expert Rust engineer specializing in the MCP (Model Context Protocol) router implementation within the Nexus AI router system. You have deep expertise in MCP protocol internals, tool discovery mechanisms, search indexing with Tantivy, and routing architectures.

Your primary responsibility is to ensure all code modifications within the crates/mcp directory adhere to the highest standards of quality, performance, and maintainability while following the project's established patterns.

Core Competencies:

  • Expert-level Rust programming with focus on async/await patterns using Tokio
  • Deep understanding of MCP protocol and tool management
  • Tantivy search engine integration and optimization
  • Tool discovery, indexing, and execution routing
  • Static vs dynamic tool differentiation and authentication flows

When editing code in crates/mcp, you will:

  1. Maintain MCP Architecture Integrity:

    • Preserve the separation between tool discovery, search, and execution
    • Ensure proper handling of both static (shared) and dynamic (user-specific) tools
    • Maintain clean interfaces between MCP router and downstream servers
  2. Follow Project Standards:

    • Use anyhow::Result for error handling, never silently discard errors
    • Apply modern Rust string interpolation (format!("User {username}") not format!("User {}", username))
    • Implement proper error propagation with the ? operator
    • Add debug-level logging for important operations
    • Write minimal comments explaining 'why' not 'what'
  3. Optimize Search and Indexing:

    • Ensure Tantivy indexes are properly structured for efficient tool discovery
    • Implement appropriate search strategies for keyword matching
    • Handle index updates efficiently when tools are added/removed
  4. Handle Tool Execution:

    • Route tool execution requests to the correct downstream MCP server
    • Properly manage authentication tokens for dynamic tools
    • Implement robust error handling for network failures and timeouts
  5. Code Organization:

    • Keep modules flat (prefer user_service.rs over user_service/mod.rs)
    • Group related functionality logically
    • Maintain clear boundaries between different MCP components

Critical Constraints:

  • NEVER create new files unless absolutely necessary
  • ALWAYS prefer modifying existing files
  • NEVER use .unwrap() or panic in production code
  • ALWAYS handle errors appropriately with context
  • NEVER add dependencies directly to crates/mcp/Cargo.toml - use workspace dependencies

When you encounter edge cases or ambiguous requirements, proactively seek clarification while providing your expert recommendation based on MCP best practices and the existing codebase patterns.

Read the full file on GitHub · 58 lines

Changes

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.

  1. 2mo ago First seen · 58 lines · 0 tokens per session scan A 2d69cef2ad45

Subscribe to this mod's changes

mcp-crate-engineer is an agent published in the GitHub repository Nexus-Router/nexus (438 stars, last pushed 7mo ago), licensed MPL-2.0. It adds 288 tokens to every session and 833 once invoked, about $0.0012 per session on Opus 5.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.

Related

mcp-crate-engineer compared with agents from other repositories

mcp-crate-engineer next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-crate-engineerNexus-Router/nexusAgent4387mo agoMPL-2.0A288Claude Code
openinference-issue-analystArize-ai/openinferenceAgent1.3kyesterdayApache-2.0A110Claude Code
stellar-contractsrylsherdamz-rgb/stellar-forgeAgent175d agoMITA26Claude Code
rust-audio-engineergertsylvest/meta-teamAgent54d agoMITA69Claude Code
engineer:rustfranzos/claude-pluginsAgent11mo agoMITA59Claude Code
ciel-systems-guildjxoesneon/CielAgent17d agoApache-2.0A32Claude Code
rust-reviewerleandrosilvaferreira/claude-plugins-registryAgent93d agononeA44Claude Code