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.2.tar.gz (58.1 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.2-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rlm_mcp_server-1.7.2.tar.gz
  • Upload date:
  • Size: 58.1 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.2.tar.gz
Algorithm Hash digest
SHA256 9cdc2ba50a36c086f86577bd0c160e3a9e64590bc11d794302653a3ce2d41c5f
MD5 56fa9fb7388258298fdc17373188c1f1
BLAKE2b-256 25db32de7eba182fb5cf4812d19be03b8deb92f9de56de9b88b947256f75fb18

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rlm_mcp_server-1.7.2-py3-none-any.whl
  • Upload date:
  • Size: 53.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 996d9365250a2ca507fbcffe88b0fa26aabee5876b88ce18b35b0f53bf383b26
MD5 d935124fb7e06fb39fb2aab3d14bf56f
BLAKE2b-256 25e929c802b6a2caf310ac2871443a2da357110536910822e81ad4ce80483fb0

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