Skip to main content
Glama
Prem MCP Server
by ucalyptus

Prem MCP Server

A Model Context Protocol (MCP) server implementation for Prem AI, enabling seamless integration with Claude and other MCP-compatible clients. This server provides access to Prem AI's powerful features through the MCP interface.

Features

  • 🤖 Chat Completions: Interact with Prem AI's language models

  • 📚 RAG Support: Retrieval-Augmented Generation with document repository integration

  • 📝 Document Management: Upload and manage documents in repositories

  • 🎭 Template System: Use predefined prompt templates for specialized outputs

  • ⚡ Streaming Responses: Real-time streaming of model outputs

  • 🛡️ Error Handling: Robust error handling and logging

Related MCP server: MCP Server Sample

Prerequisites

  • Node.js (v16 or higher)

  • A Prem AI account with API key

  • A Prem project ID

Installation

Installing via Smithery

To install prem-mcp-server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @ucalyptus/prem-mcp-server --client claude

Installing Manually

# Using npm
npm install prem-mcp-server

# Using yarn
yarn add prem-mcp-server

# Using pnpm
pnpm add prem-mcp-server

Configuration

1. Environment Variables

Create a .env file in your project root:

PREM_API_KEY=your_api_key_here
PREM_PROJECT_ID=your_project_id_here

2. Cursor Configuration

To use the Prem MCP server with Cursor, add the following to your ~/.cursor/mcp.json:

{
  "mcpServers": {
    "PremAI": {
      "command": "node",
      "args": ["/path/to/your/prem-mcp/build/index.js", "--stdio"],
      "env": {
        "PREM_API_KEY": "your_api_key_here",
        "PREM_PROJECT_ID": "your_project_id_here"
      }
    }
  }
}

Replace /path/to/your/prem-mcp with the actual path to your project directory.

3. Claude Desktop Configuration

For Claude Desktop users, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "PremAI": {
      "command": "npx",
      "args": ["prem-mcp-server", "--stdio"],
      "env": {
        "PREM_API_KEY": "your_api_key_here",
        "PREM_PROJECT_ID": "your_project_id_here"
      }
    }
  }
}

Usage

Starting the Server

npx prem-mcp-server

Example Prompts

  1. Basic Chat

Let's have a conversation about artificial intelligence.
  1. RAG with Documents

Based on the documents in repository XYZ, what are the key points about [topic]?
  1. Using Templates

Use template ABC to generate [specific type of content].

Document Upload

The server supports uploading documents to Prem AI repositories for RAG operations. Supported formats:

  • .txt

  • .pdf

  • .docx

API Reference

Chat Completion Parameters

  • query: The input text

  • system_prompt: Custom system prompt

  • model: Model identifier

  • temperature: Response randomness (0-1)

  • max_tokens: Maximum response length

  • repository_ids: Array of repository IDs for RAG

  • similarity_threshold: Threshold for document similarity

  • limit: Maximum number of document chunks

Template Parameters

  • template_id: ID of the prompt template

  • params: Template-specific parameters

  • temperature: Response randomness (0-1)

  • max_tokens: Maximum response length

Development

# Clone the repository
git clone https://github.com/yourusername/prem-mcp-server.git

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Troubleshooting

Common Issues

  1. Server Not Found

    • Verify the server path in claude_desktop_config.json

    • Check if the server is running

  2. API Key Invalid

    • Ensure your Prem AI API key is valid

    • Check if the API key has the required permissions

  3. Document Upload Failed

    • Verify file format is supported

    • Check file permissions

    • Ensure repository ID is correct

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Acknowledgments

Support

For issues and feature requests, please use the GitHub Issues page.

Available Tools

3 tools
chatC

Chat with Prem AI - supports chat completions with optional RAG capabilities.

Inputs: query (required), system_prompt, model, temperature, +4 more.

prem_chat_with_templateC

Chat using a predefined Prem AI prompt template

Inputs: template_id (required), params (required), model, temperature, +1 more.

prem_upload_documentC

Upload a document to a Prem AI repository

Inputs: repository_id (required), file_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 3 tools

    Disambiguation3/5

    The tools have some overlap but are distinguishable by their specific functions. 'chat' and 'prem_chat_with_template' both handle chat completions, which could cause confusion, but 'prem_chat_with_template' specifies template usage, and 'prem_upload_document' is clearly distinct for document uploads. The descriptions help differentiate them, but the chat-focused tools have ambiguous boundaries.

    Naming Consistency2/5

    The naming is inconsistent with mixed conventions. 'chat' uses a simple verb, 'prem_chat_with_template' uses a verbose prefix and underscores, and 'prem_upload_document' follows a similar pattern but differs in structure. There is no uniform verb_noun pattern, and the prefix 'prem_' is applied inconsistently, leading to a chaotic naming style.

    Tool Count3/5

    With 3 tools, the count is borderline for a server's scope. It feels thin, potentially lacking operations like document retrieval or template management, but it covers basic chat and document upload functionalities. For a Prem AI server, more tools might be expected to handle a complete workflow, making this slightly under-scoped.

    Completeness2/5

    There are significant gaps in the tool surface for a Prem AI domain. The tools cover chat completions and document upload but lack operations for retrieving documents, managing templates, or performing other AI tasks like embeddings or fine-tuning. This incomplete coverage will likely cause agent failures when trying to execute common workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers