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.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.svg" alt="Measured on agentmods" 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 $0.00144 $0.00417
Sonnet 5 $0.00058 $0.00167
Haiku 4.5 $0.00029 $0.00083

Measured 7d ago against content hash 2d69cef2ad45, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 7d 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. 7d 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 (435 stars, last pushed 5mo ago), licensed MPL-2.0. It adds 288 tokens to every session and 833 once invoked, about $0.0014 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.

Related

Other agents, from other repositories

backend-author

Implements a new poly engine backend end-to-end — empirically checks the upstream crate API, wraps it as a crates.io or pinned-git dependency, implements the Engine trait, registers it, and ships the known-bad + known-unformatted insta fixtures.

Goldziher/poly · 55 tokens

stellar-contracts

Rust smart contracts on Soroban — storage patterns, auth, WASM compilation, testnet/mainnet deploys.

rylsherdamz-rgb/stellar-forge · 26 tokens

rust-audio-engineer

Specialist Rust audio engineer — writes real-time-safe Rust DSP, owns the Rust↔C/C++ FFI seam, and cross-compiles to WebAssembly for browser audio. Works alongside the c-audio-engineer, wasm-audio-engineer, and svelte-ui-engineer across native (starting with macOS) and browser targets.

gertsylvest/meta-team · 75 tokens

engineer:rust

Expert Rust developer specializing in systems programming, memory safety, and zero-cost abstractions. Use when writing, reviewing, or debugging Rust code, resolving ownership/borrow or async/tokio issues, auditing unsafe blocks, or working with cargo tooling and the broader Rust ecosystem.

franzos/claude-plugins · 59 tokens

ciel-systems-guild

CIEL's elite systems engineering guild. Specializes in Rust, C++, Go, Elixir, and high-performance architecture.

jxoesneon/Ciel · 32 tokens

rust-pro

Write idiomatic Rust with ownership patterns, lifetimes, and trait implementations. Masters async/await, safe concurrency, and zero-cost abstractions. Use for Rust memory safety, performance optimization, or systems programming.

AcKeskin/contexture · 45 tokens