Skip to main content
Glama
ucalyptus
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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe chat message to send
system_promptNoOptional system prompt to guide the model's behavior
modelNoOptional model to use for completion
temperatureNoOptional temperature for response generation
max_tokensNoOptional maximum tokens to generate
repository_idsNoOptional array of repository IDs for RAG
similarity_thresholdNoOptional similarity threshold for RAG
limitNoOptional limit of context chunks for RAG

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'chat completions with optional RAG capabilities' but doesn't describe key behavioral traits like whether this is a read-only or mutating operation, authentication requirements, rate limits, response format, or error handling. For a chat tool with 8 parameters and no annotations, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded: a single sentence that captures the core functionality. Every word earns its place with no redundancy or unnecessary elaboration. The structure efficiently communicates the tool's purpose without wasting space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, no output schema, no annotations), the description is incomplete. It doesn't address behavioral aspects, usage context, or output expectations. While the schema covers parameters well, the description fails to provide the additional context needed for an agent to understand when and how to use this tool effectively, especially compared to siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'optional RAG capabilities', which loosely relates to parameters like repository_ids, similarity_threshold, and limit. However, it doesn't provide additional semantic context or usage examples beyond what's in the parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Chat with Prem AI - supports chat completions with optional RAG capabilities.' It specifies the verb ('Chat with'), resource ('Prem AI'), and key capabilities (chat completions with optional RAG). However, it doesn't explicitly differentiate from sibling tools like 'prem_chat_with_template' beyond mentioning RAG capabilities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'prem_chat_with_template' or 'prem_upload_document'. It mentions optional RAG capabilities but doesn't specify scenarios where RAG is beneficial or when to choose this tool over siblings. No explicit when/when-not statements or alternative recommendations are included.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

prem_chat_with_templateC

Chat using a predefined Prem AI prompt template

ParametersJSON Schema
NameRequiredDescriptionDefault
template_idYesID of the prompt template to use
paramsYesParameters to fill in the template
modelNoOptional model to use
temperatureNoOptional temperature parameter
max_tokensNoOptional maximum tokens to generate

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Chat') but lacks details on permissions, rate limits, response format, or potential side effects. For a tool with multiple parameters and no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, nested objects, no output schema) and lack of annotations, the description is incomplete. It doesn't explain return values, error conditions, or behavioral nuances, leaving the agent with insufficient context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond implying template-based chat, which is already covered by the schema's parameter descriptions. This meets the baseline for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Chat') and resource ('using a predefined Prem AI prompt template'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'chat' or 'prem_upload_document', which would require more specific language about template-based versus direct chat functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'chat' or 'prem_upload_document', nor does it specify prerequisites such as needing a pre-existing template or appropriate parameters. This leaves the agent without clear usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

prem_upload_documentC

Upload a document to a Prem AI repository

ParametersJSON Schema
NameRequiredDescriptionDefault
repository_idYesID of the repository to upload to
file_pathYesPath to the file to upload

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'Upload' which implies a write operation, but doesn't disclose behavioral traits like authentication requirements, file size limits, supported formats, error handling, or what happens on success. This leaves significant gaps for an upload tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasteβ€”it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded for an upload operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation tool (upload), the description is incomplete. It lacks details on permissions, return values, error cases, or operational limits, which are critical for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (repository_id, file_path). The description doesn't add any meaning beyond what the schema provides, such as examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Upload') and target resource ('document to a Prem AI repository'), making the purpose immediately understandable. It doesn't differentiate from sibling tools (chat, prem_chat_with_template), which are unrelated communication tools, so it doesn't need explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It simply states what the tool does without context about appropriate scenarios or constraints.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

C2.8/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ucalyptus/prem-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server