
Conversation
STDIOMCP server for managing conversations with OpenRouter language models.
MCP server for managing conversations with OpenRouter language models.
A Model Context Protocol (MCP) server implementation for managing conversations with OpenRouter's language models. This server provides a standardized interface for applications to interact with various language models through a unified conversation management system.
MCP Protocol Support
OpenRouter Integration
Conversation Management
Streaming Support
File System Persistence
npm install mcp-conversation-server
All configuration for the MCP Conversation Server is now provided via YAML. Please update the config/models.yaml
file with your settings. For example:
# MCP Server Configuration openRouter: apiKey: "YOUR_OPENROUTER_API_KEY" # Replace with your actual OpenRouter API key. persistence: path: "./conversations" # Directory for storing conversation data. models: # Define your models here 'provider/model-name': id: 'provider/model-name' contextWindow: 123456 streaming: true temperature: 0.7 description: 'Model description' # Default model to use if none specified defaultModel: 'provider/model-name'
The MCP Conversation Server now loads all its configuration from the YAML file. In your application, you can load the configuration as follows:
const config = await loadModelsConfig(); // Loads openRouter, persistence, models, and defaultModel settings from 'config/models.yaml'
Note: Environment variables are no longer required as all configuration is provided via the YAML file.
import { ConversationServer } from 'mcp-conversation-server'; const server = new ConversationServer(config); server.run().catch(console.error);
The server exposes several MCP tools:
create-conversation
{ provider: 'openrouter', // Provider is always 'openrouter' model: string, // OpenRouter model ID (e.g., 'anthropic/claude-3-opus-20240229') title?: string; // Optional conversation title }
send-message
{ conversationId: string; // Conversation ID content: string; // Message content stream?: boolean; // Enable streaming responses }
list-conversations
{ filter?: { model?: string; // Filter by model startDate?: string; // Filter by start date endDate?: string; // Filter by end date } }
The server provides access to several resources:
conversation://{id}
conversation://list
npm run build
npm test
The server provides several debugging features:
Error Logging
MCP Inspector
npm run inspector
Use the MCP Inspector to:
Provider Validation
await server.providerManager.validateProviders();
Validates:
Common issues and solutions:
OpenRouter Connection Issues
Message Streaming Errors
File System Errors
ISC License