Nexus MCP Server

Nexus MCP Server

Enables hybrid web search and intelligent content extraction, combining semantic search with documentation-optimized reading that strips noise and returns clean, token-efficient context for AI agents.

Category
访问服务器

README

🌐 Nexus MCP Server

The Hybrid Search & Retrieval Engine for AI Agents.

Nexus is a local Model Context Protocol (MCP) server that combines the best features of Exa (semantic web search) and Ref (documentation-optimized reading). It provides your AI agent (Claude, Cursor, etc.) with the ability to search the web and extract surgical, token-efficient context from documentation without requiring external API keys.

✨ Features

1. Hybrid Search (nexus_search)

Nexus understands that searching for news is different from searching for API docs.

  • General Mode: Performs broad web searches (like Exa) to find articles, news, and general information.
  • Docs Mode: Automatically filters results to prioritize technical domains (readthedocs, github, stackoverflow, official documentation).

2. Intelligent Reading (nexus_read)

Nexus doesn't just dump HTML into your context window. It parses content based on intent.

  • General Focus: Cleans articles, removing ads, navigation bars, and fluff. Perfect for reading news or blog posts.
  • Code Focus: Aggressively strips conversational text, retaining only Headers, Code Blocks, and Tables. This mimics ref.tools, ensuring your model gets pure syntax without the noise.
  • Auto-Detect: Automatically switches to "Code Focus" when visiting technical sites like GitHub or API references.

3. Privacy & Cost

  • No API Keys Required: Uses DuckDuckGo for search and standard HTTP requests for retrieval.
  • Runs Locally: Your data stays on your machine until the cleaned context is sent to the LLM.

🛠️ Installation

Prerequisites

  • Python 3.10+
  • uv (Recommended) or pip

Quick Install (Recommended)

Install directly from GitHub - no cloning needed:

# Using uvx (no installation, runs on-demand)
uvx --from git+https://github.com/rcdelacruz/nexus-mcp.git nexus-mcp

# Or install with pip
pip install git+https://github.com/rcdelacruz/nexus-mcp.git

Development Install

For local development or contributing:

  1. Clone the repository:
git clone https://github.com/rcdelacruz/nexus-mcp.git
cd nexus-mcp
  1. Install in development mode:
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the package in editable mode
pip install -e .
  1. For development with testing tools:
pip install -e ".[dev]"

⚙️ Configuration

Claude Code (CLI)

Quick Setup (Recommended - Install from GitHub):

# Add the server globally (available in all projects)
claude mcp add nexus --scope user -- \
  uvx --from git+https://github.com/rcdelacruz/nexus-mcp.git nexus-mcp

# Verify installation
claude mcp list        # Should show: ✓ Connected

Alternative: Local Development Setup

If you cloned the repository for development:

# Navigate to nexus-mcp directory
cd /path/to/nexus-mcp

# Install dependencies first
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

# Add the server to Claude Code (project scope)
claude mcp add nexus --scope project -- \
  $(pwd)/.venv/bin/python $(pwd)/nexus_server.py

# Verify installation
claude mcp list

Configuration Scopes:

  • --scope user - Available across all projects (recommended for GitHub install)
  • --scope project - Creates .mcp.json (shareable via git)
  • --scope local - Personal config in ~/.claude.json

Check server status:

claude mcp list        # Should show: nexus - ✓ Connected
/mcp                   # In conversation: shows available tools

Claude Desktop / Cursor

Config Location:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Recommended: Install from GitHub with uvx

{
  "mcpServers": {
    "nexus": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/rcdelacruz/nexus-mcp.git",
        "nexus-mcp"
      ]
    }
  }
}

Alternative: Using local installation

After running pip install git+https://github.com/rcdelacruz/nexus-mcp.git:

{
  "mcpServers": {
    "nexus": {
      "command": "nexus-mcp"
    }
  }
}

For local development:

If you cloned the repo and installed with pip install -e .:

{
  "mcpServers": {
    "nexus": {
      "command": "/ABSOLUTE/PATH/TO/.venv/bin/python",
      "args": ["/ABSOLUTE/PATH/TO/nexus_server.py"]
    }
  }
}

Replace /ABSOLUTE/PATH/TO/ with the actual path to your clone.


🚀 Usage

Once connected, simply prompt Claude naturally. Nexus handles the tool selection.

Verify It's Working

Check server connection:

claude mcp list
# Should show: nexus - ✓ Connected

# In a Claude Code conversation:
/mcp
# Should show nexus with 2 tools available

See VERIFICATION.md for detailed testing instructions.

Scenario 1: Technical Research (Ref Emulation)

User: "How do I use asyncio.gather in Python? Check the docs."

  • Nexus Action:
    1. Search: nexus_search(query="python asyncio gather", mode="docs")
    2. Read: nexus_read(url="docs.python.org/...", focus="code")
  • Result: The AI receives only the function signature and code examples, saving context window space.

Scenario 2: General Research (Exa Emulation)

User: "Search for the latest updates on the NVIDIA Blackwell chip."

  • Nexus Action:
    1. Search: nexus_search(query="NVIDIA Blackwell updates", mode="general")
    2. Read: nexus_read(url="techcrunch.com/...", focus="general")
  • Result: The AI reads a clean, ad-free summary of the news article.

🧠 Architecture

Nexus is built on the Model Context Protocol using the FastMCP Python SDK.

Component Technology Purpose
MCP Framework FastMCP Server implementation and tool registration
Search Backend DDGS (DuckDuckGo) Free web search without API keys
HTTP Client httpx Async HTTP requests with timeout handling
HTML Parsing BeautifulSoup4 Intelligent content extraction
Doc Detection Heuristic URL matching Auto-detection of technical sites

Production Features

Comprehensive Error Handling - All edge cases covered with graceful fallbacks

Input Validation - URL format, parameter bounds, and mode validation

Proper Logging - Structured logging instead of print statements

Configurable Limits - Timeouts, content length, and result counts

85% Test Coverage - 19 comprehensive unit tests

Type Hints - Full type annotations for better IDE support

Dependency Management - Modern pyproject.toml configuration


🧪 Testing

Run the test suite:

# Activate virtual environment
source .venv/bin/activate

# Run all tests with coverage
pytest

# Run specific test file
pytest tests/test_nexus_server.py -v

# Run manual integration test
python test_manual.py

📊 Project Structure

nexus-mcp/
├── nexus_server.py      # Main MCP server implementation
├── tests/               # Comprehensive test suite
│   ├── __init__.py
│   └── test_nexus_server.py
├── test_manual.py       # Manual integration testing
├── pyproject.toml       # Project configuration & dependencies
├── LICENSE              # MIT License
├── README.md            # This file
└── .gitignore          # Git ignore rules

🤝 Contributing

Contributions are welcome! Please ensure:

  • All tests pass (pytest)
  • Code coverage remains above 80%
  • Follow existing code style and patterns
  • Add tests for new features

📄 License

MIT License - See LICENSE file for details. Free to use and modify.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选