03-mcp-server

03-mcp-server is a cursor rule for Windsurf from hfredrick69/deep-research-mcp-server. It costs 37 tokens per session (1,883 once invoked), scanned A, original, MIT.

Implementation rules for an MCP server that exposes a deep-research tool to AI clients. The server handles requests, calls the research pipeline, caches repeated work, and communicates locally through standard input and output.

In plain words
What is it for?
Use them when changing the MCP tool registration, request handler, local transport, cache key, logging, or connection to the research pipeline.
Why use it?
They define a clean and testable tool interface and consistent handling of caching, logging, transport, and generated research reports.

Cursor rule for Windsurf

Written for Windsurf: installed under .windsurf/.

Good fit Use them when changing the MCP tool registration, request handler, local transport, cache key, logging, or connection to the research pipeline.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/hfredrick69/deep-research-mcp-server/03-mcp-server
Install

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.

Clone the repo
git clone --depth 1 https://github.com/hfredrick69/deep-research-mcp-server

Made for: Windsurf.

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 03-mcp-server

README.md
[![agentmods](https://agentmods.dev/badge/rules/hfredrick69/deep-research-mcp-server/03-mcp-server/github.svg)](https://agentmods.dev/rules/hfredrick69/deep-research-mcp-server/03-mcp-server)
Your own site
<a href="https://agentmods.dev/rules/hfredrick69/deep-research-mcp-server/03-mcp-server"><img src="https://agentmods.dev/badge/rules/hfredrick69/deep-research-mcp-server/03-mcp-server/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 03-mcp-server

Your own site · 80×15
<a href="https://agentmods.dev/rules/hfredrick69/deep-research-mcp-server/03-mcp-server"><img src="https://agentmods.dev/badge/rules/hfredrick69/deep-research-mcp-server/03-mcp-server.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,883 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.00037 $0.01883
Opus 5.5 $0.00015 $0.00753
Sonnet 5.5 $0.00007 $0.00377
Haiku 4.5 $0.00004 $0.00188

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

Security

Grade A, and why

03-mcp-server 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 yesterday.

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.

.windsurf/rules/03-mcp-server.md · 157 lines

How it starts

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

MCP Server Rules (src/mcp-server.ts)

Last reviewed: 2025-08-11 Timestamp: 2025-08-11T08:21:00-04:00

These rules align src/mcp-server.ts with @modelcontextprotocol/sdk best practices and your project’s research pipeline.

Scope & Goals

  • Ensure the server exposes a clean, testable tool interface for deep research.
  • Favor stdio transport for local/CLI and consider Streamable HTTP for deployment.
  • Keep outputs deterministic, cache-aware, and friendly for agent clients.

Project Flow Overview (Current Code)

  • src/mcp-server.ts registers a single tool deep-research using server.tool(...).
  • Tool handler calls research() and writeFinalReport() from src/deep-research.ts.
  • Caching via LRUCache in mcp-server.ts with key JSON.stringify({ query, depth, breadth, existingLearnings }).
  • Transport: StdioServerTransport(process.stdin, process.stdout) with server.connect(transport). This matches current code. Using new StdioServerTransport() without args is also valid per SDK docs.
  • Logging: helper log() writes to stderr; progress notifications are logged only (no custom notifications emitted).
  • Current search provider in orchestrator: Firecrawl (migration to Exa planned; see Notes).

Agents & Tools Summary

  • Tools exposed: one MCP tool deep-research.
  • Orchestrator: research(options) in src/deep-research.ts (batches Gemini via generateBatch(); uses text splitters; composes final via writeFinalReport()).
  • Feedback helper: generateFeedback() in src/feedback.ts (not exposed as MCP tool by default).

Server & Transport

  • Instantiate server with name/version and optional debounced notifications:
    import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
    import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
    
    const server = new McpServer(
      { name: 'deep-research', version: '1.0.0' },
      {
        // Reduce message spam during rapid list changes
        debouncedNotificationMethods: [
          'notifications/tools/list_changed',
          'notifications/resources/list_changed',
          'notifications/prompts/list_changed'
        ]
      }
    );
    
    // Current code passes streams explicitly; either form is acceptable
    const transport = new StdioServerTransport(process.stdin, process.stdout);
    await server.connect(transport);
    
    • SDK also supports new StdioServerTransport() without args. Current code uses explicit streams; both are valid.
    • Prefer await server.connect(transport) (async) vs promise chaining for clarity.

Read the full file on GitHub · 157 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. yesterday First seen · 157 lines · 37 tokens per session scan A d9cf397bcb0d

Subscribe to this mod's changes

03-mcp-server is a cursor rule published in the GitHub repository hfredrick69/deep-research-mcp-server (0 stars, last pushed 2d ago), licensed MIT. It adds 37 tokens to every session and 1,883 once invoked, about $0.0001 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-10-30.