Skip to main content

Hosted MCP server for RLM SaaS - Context-efficient documentation queries

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Snipara MCP Server

Context Optimization Server for LLMs via the Model Context Protocol (MCP).

Turn 500K tokens of documentation into 5K tokens of perfectly relevant context.

What is Snipara?

Snipara is a Context Optimization as a Service platform. We don't run your LLM - we optimize and deliver the most relevant context to your LLM (Claude, GPT, Gemini, etc.).

Key Benefits:

  • 90% cost reduction - From $0.83 to $0.08 per query
  • Near-infinite context - Handle docs 100x larger than your context window
  • Session persistence - Context survives compaction events
  • Use your own LLM - Zero vendor lock-in

MCP Tools

This server exposes the following MCP tools:

Primary Tools

Tool Description
rlm_context_query Main tool - Returns optimized context for a query with token budget
rlm_decompose Break complex queries into sub-queries
rlm_multi_query Execute multiple queries in one call

Document Management Tools

Tool Description
rlm_upload_document Upload or update a single document
rlm_sync_documents Bulk sync multiple documents (for CI/CD)
rlm_settings Get project settings from dashboard

Supporting Tools

Tool Description
rlm_ask Query documentation with natural language
rlm_search Search for patterns (regex)
rlm_inject Inject session context
rlm_context Show current session context
rlm_clear_context Clear session context
rlm_stats Show documentation statistics
rlm_sections List all documentation sections
rlm_read Read specific line ranges

Quick Start

Using Snipara Cloud (Recommended)

Sign up at snipara.com and get your MCP endpoint:

https://api.snipara.com/v1/YOUR_PROJECT_ID/mcp

Self-Hosting

  1. Clone this repository:
git clone https://github.com/alopez3006/snipara-mcp-server.git
cd snipara-mcp-server
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment:
cp .env.example .env
# Edit .env with your database URL and settings
  1. Run the server:
uvicorn src.server:app --host 0.0.0.0 --port 8000

Integration

Claude Code

claude mcp add snipara https://api.snipara.com/v1/YOUR_PROJECT_ID/mcp

Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "snipara": {
      "url": "https://api.snipara.com/v1/YOUR_PROJECT_ID/mcp"
    }
  }
}

Continue.dev

Add to your ~/.continue/config.json:

{
  "mcpServers": [
    {
      "name": "snipara",
      "transport": {
        "type": "sse",
        "url": "https://api.snipara.com/v1/YOUR_PROJECT_ID/mcp/sse"
      }
    }
  ]
}

API Reference

POST /v1/{project_id}/mcp

MCP endpoint for tool calls.

Headers:

  • Authorization: Bearer YOUR_API_KEY
  • Content-Type: application/json

Example Request:

{
  "method": "tools/call",
  "params": {
    "name": "rlm_context_query",
    "arguments": {
      "query": "How does authentication work?",
      "max_tokens": 4000,
      "search_mode": "hybrid"
    }
  }
}

Example Response:

{
  "sections": [
    {
      "title": "Authentication Flow",
      "content": "...",
      "file": "docs/auth.md",
      "lines": [45, 120],
      "relevance_score": 0.94,
      "token_count": 1200
    }
  ],
  "total_tokens": 3800,
  "suggestions": ["Also check: docs/security.md"]
}

Document Upload

Via MCP Tool

Upload documents directly from your LLM client:

rlm_upload_document(path="CLAUDE.md", content="# My Project\n...")

Via Webhook (CI/CD)

Sync documents on git push:

curl -X POST "https://api.snipara.com/v1/YOUR_PROJECT_ID/webhook/sync" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      {"path": "CLAUDE.md", "content": "# My Project..."},
      {"path": "docs/api.md", "content": "# API Reference..."}
    ],
    "delete_missing": false
  }'

GitHub Action Example

name: Sync Docs to Snipara
on:
  push:
    paths: ['**/*.md']
jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Collect and sync docs
        run: |
          # Build JSON payload with all markdown files
          docs=$(find . -name '*.md' -not -path './node_modules/*' | while read f; do
            content=$(cat "$f" | jq -Rs .)
            echo "{\"path\": \"${f#./}\", \"content\": $content}"
          done | jq -s '{documents: .}')

          curl -X POST "${{ secrets.SNIPARA_WEBHOOK_URL }}" \
            -H "X-API-Key: ${{ secrets.SNIPARA_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d "$docs"

Environment Variables

Variable Description Required
DATABASE_URL PostgreSQL connection string Yes
OPENAI_API_KEY For embeddings (semantic search) For Pro+
REDIS_URL For caching Optional
LOG_LEVEL Logging level (INFO, DEBUG, etc.) No

Architecture

┌─────────────────────────────────────────────────────┐
│  MCP Client (Claude Code, Cursor, etc.)             │
└─────────────────────┬───────────────────────────────┘
                      │ MCP Protocol
┌─────────────────────▼───────────────────────────────┐
│  Snipara MCP Server                                 │
│  ┌──────────────┐  ┌──────────────┐  ┌───────────┐ │
│  │ Keyword      │  │ Semantic     │  │ Hybrid    │ │
│  │ Search       │  │ Search       │  │ Ranking   │ │
│  └──────────────┘  └──────────────┘  └───────────┘ │
│  ┌──────────────┐  ┌──────────────┐  ┌───────────┐ │
│  │ Chunking     │  │ Token        │  │ Session   │ │
│  │ Engine       │  │ Budgeting    │  │ Context   │ │
│  └──────────────┘  └──────────────┘  └───────────┘ │
└─────────────────────┬───────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────┐
│  PostgreSQL (Documents, Sessions, Usage)            │
└─────────────────────────────────────────────────────┘

License

MIT License - see LICENSE for details.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rlm_mcp_server-1.7.0.tar.gz (56.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rlm_mcp_server-1.7.0-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file rlm_mcp_server-1.7.0.tar.gz.

File metadata

  • Download URL: rlm_mcp_server-1.7.0.tar.gz
  • Upload date:
  • Size: 56.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for rlm_mcp_server-1.7.0.tar.gz
Algorithm Hash digest
SHA256 03cccb9e67076b67525a94bce4a435141a4783e61567818389168d6ed4d3f5a2
MD5 e036a79c56a20e91a3ee6c0b5dd17e95
BLAKE2b-256 cacfc32f244d88f640d3cdce6b0e7e72e454fcf0e69d5f43faedca8f3a81b7ee

See more details on using hashes here.

File details

Details for the file rlm_mcp_server-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: rlm_mcp_server-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 52.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for rlm_mcp_server-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 352985d550ce105d565511e677dbc76fcb8a2ccfb25e13ef687d41d77ff28ae7
MD5 86dde67bdd164c33f3a2ea001f98d202
BLAKE2b-256 1a8739b83ceab73f6f000134a098a5042327613659b4a1cf084a482eec57f717

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page