Labsco
adawalli logo

Nexus

β˜… 22

from adawalli

Web search server that integrates Perplexity Sonar models via OpenRouter API for real-time, context-aware search with citations

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup
<!-- markdownlint-disable MD033 MD041 --> <div align="center">

πŸ” Nexus MCP Server

AI integration without the complexity

npm version NPM Downloads License: MIT TypeScript MCP Compatible CodeRabbit Pull Request Reviews

Trust Score

Intelligent AI model search and discovery with zero-install simplicity

Quick Start β€’ Features β€’ Documentation β€’ Contributing

</div>

What is Nexus?

Nexus is a Model Context Protocol (MCP) server that provides AI-powered search functionality through the OpenRouter API. It integrates with MCP-compatible clients including Claude Desktop and Cursor, providing search capabilities via multiple model families including Perplexity Sonar (real-time web search) and Grok 4 (training-data knowledge).

Key Characteristics

  • Zero-install deployment: Executable via bunx (or npx) with no build requirements
  • OpenRouter integration: Multiple AI models including Perplexity Sonar (web search) and Grok 4 (training data)
  • MCP protocol compliance: Implements standard MCP tool and resource interfaces
  • Production architecture: Includes request caching, deduplication, retry logic, and error handling
  • Type-safe implementation: Full TypeScript coverage with strict type checking

Features

Deployment

  • Bunx/NPX-based execution with zero local installation
  • Cross-platform compatibility (macOS, Linux, Windows)
  • Bun 1.0+ or Node.js 18+ runtime requirement
  • Automated version updates via npm registry

Search Capabilities

  • Multiple model tiers with different capabilities:
    • sonar - Fast Q&A, real-time web search (30s timeout, standard tier)
    • sonar-pro - Multi-step queries, real-time web search (60s timeout, premium tier)
    • sonar-reasoning-pro - Chain-of-thought reasoning, real-time web search (120s timeout, premium tier)
    • sonar-deep-research - Exhaustive research reports, real-time web search (300s timeout, premium tier)
    • grok-4 - Training-data knowledge, no real-time search (60s timeout, premium tier)
  • Real-time web search with current information (Perplexity models)
  • Training-data knowledge responses (Grok 4)
  • Structured citation extraction from responses
  • Configurable model parameters (temperature, max tokens, timeout override)

Architecture

  • Comprehensive error handling with typed error classes
  • Request caching with configurable TTL
  • Request deduplication for concurrent identical queries
  • Automatic retry logic with exponential backoff
  • Winston-based structured logging
  • TypeScript strict mode implementation with full type coverage

Integration with MCP Clients

Configure MCP clients to execute the server via bunx:

Claude Code

Configuration in ~/.claude/mcp_settings.json:

{
  "mcpServers": {
    "nexus": {
      "command": "bunx",
      "args": ["nexus-mcp"],
      "env": {
        "OPENROUTER_API_KEY": "your-api-key-here"
      }
    }
  }
}

Restart Claude Code after configuration changes.

Cursor

Add server configuration in Cursor's MCP settings:

  • Name: nexus
  • Command: bunx
  • Args: ["nexus-mcp"]
  • Environment Variables: OPENROUTER_API_KEY=your-api-key-here

Restart Cursor after configuration changes.

Generic MCP Client Configuration

Standard MCP client connection parameters:

  • Transport: stdio
  • Command: bunx
  • Args: ["nexus-mcp"]
  • Environment: OPENROUTER_API_KEY=your-api-key-here

Alternative: npx or Local Installation

If you don't have Bun installed, use npx in place of bunx in any of the configurations above.

For a local installation (after following the local development setup):

{
  "mcpServers": {
    "nexus": {
      "command": "bun",
      "args": ["run", "/path/to/nexus-mcp/dist/cli.js"],
      "env": {
        "OPENROUTER_API_KEY": "your-api-key-here"
      }
    }
  }
}

Available Tools

The main search tool that provides AI-powered search capabilities.

Parameters:

  • query (required): Search query (1-2000 characters)
  • model (optional): Model to use (default: sonar)
    • sonar - Fast Q&A with real-time web search (30s timeout)
    • sonar-pro - Multi-step queries with real-time web search (60s timeout, premium)
    • sonar-reasoning-pro - Chain-of-thought reasoning with real-time web search (120s timeout, premium)
    • sonar-deep-research - Exhaustive research reports with real-time web search (300s timeout, premium)
    • grok-4 - Training-data knowledge, no real-time search (60s timeout, premium)
  • maxTokens (optional): Maximum response tokens (1-4000, default: 1000)
  • temperature (optional): Response randomness (0-2, default: 0.3)
  • timeout (optional): Override default timeout in milliseconds (5000-600000)

Example Response (Perplexity model):

Based on current information, here are the latest developments in AI...

[Detailed AI-generated response with current information]

---
**Search Metadata:**
- Model: perplexity/sonar
- Response time: 1250ms
- Tokens used: 850
- Timeout: 30000ms
- Search type: realtime
- Sources: 5 found

Example Response (Grok 4 model):

Quantum computing is a type of computation that harnesses quantum mechanics...

[Response based on training data knowledge]

---
**Search Metadata:**
- Model: x-ai/grok-4
- Response time: 3500ms
- Tokens used: 650
- Timeout: 60000ms
- Search type: training-data
- Cost tier: premium

Resources

The server provides a configuration status resource at config://status that shows:

  • Server health status
  • Configuration information (with masked API key)
  • Search tool availability
  • Server uptime and version

Development

For developers working on this server:

# Development with hot reload
bun run dev

# Run tests
bun run test

# Run tests with coverage
bun run test:coverage

# Lint code
bun run lint

# Format code
bun run format

API Costs

OpenRouter charges for API usage based on token consumption:

  • Pricing: See current rates at OpenRouter Models
  • Monitoring: Usage tracking available in OpenRouter dashboard
  • Limits: Configure spending limits in OpenRouter account settings
  • Optimization: Server implements response caching and request deduplication to minimize redundant API calls

πŸ“š Documentation

<div align="center">
πŸ“– GuideπŸ”— LinkπŸ“ Description
Quick StartGetting StartedZero-install setup in 30 seconds
API ReferenceMCP ToolsComplete command reference
ConfigurationEnvironment SetupAdvanced configuration options
ContributingContributing GuideJoin our open source community
TroubleshootingCommon IssuesSolutions to common problems
</div>

🀝 Contributing

We welcome contributions from developers of all experience levels!

<table> <tr> <td width="33%">

πŸš€ Get Started

</td> <td width="33%">

πŸ› Report Issues

</td> <td width="33%">

πŸ’¬ Join Community

</td> </tr> </table>

🌟 Recognition

Contributors are recognized in our:

  • Contributors list
  • Release notes for significant contributions
  • Community spotlights and testimonials

πŸ“ž Support & Community

<div align="center">
πŸ’¬ Need Help?πŸ”— Resource
Quick QuestionsGitHub Discussions
Bug ReportsGitHub Issues
DocumentationOpenRouter Docs β€’ MCP Specification
Feature RequestsEnhancement Proposals
</div>

πŸ“„ License

MIT License - see LICENSE file for details.


<div align="center">

Made with ❀️ by the open source community

⭐ Star us on GitHub β€’ πŸ“¦ View on NPM β€’ πŸ“š Read the Docs

Nexus: AI integration without the complexity

Star History Chart

</div>