Idiomark MCP Server
The Idiomark MCP (Model Context Protocol) Server enables AI assistants like Claude to understand and apply personality context. Think of it as Context7 for personality - while Context7 serves code documentation, this serves personality documentation.
Overview
The MCP Server operates in two distinct modes:
+-------------------------------------------------------------+
| Idiomark MCP Server |
| |
| +-------------------+ +-------------------+ |
| | Context Mode | | Engine Mode | |
| | (Read-Only) | | (Generative) | |
| +-------------------+ +-------------------+ |
| |
| Context: Like Context7 serves code, |
| this serves personality "documentation" |
| |
| Engine: Generates responses with personality |
| applied (local LLM or user's API key) |
+-------------------------------------------------------------+
Context Mode
Read-only personality data access. No external API calls, all data stays local. This is the default mode when no LLM configuration is provided.
Available Tools:
query_domain- Query domain expertise from personalitycheck_value_conflict- Check if text conflicts with personality valuesget_voice- Get voice parameters (tone, formality, humor, etc.)get_system_prompt- Get system prompt for this personality
Available Resources:
idiomark:///personality- Full Idiomark personality fileidiomark:///metadata- Idiomark file metadataidiomark:///voice- Voice characteristicsidiomark:///values- Core values and principlesidiomark:///domains- Domain expertise areasidiomark:///knowledge- Knowledge graphidiomark:///patterns- Communication patterns
Engine Mode
Generative mode with personality applied. Requires an LLM (local or cloud). Enables all Context tools plus generative tools.
Additional Tools:
generate_response- Generate AI response with personality appliedapply_voice- Transform text to match personality voicesuggest_actions- Suggest actions based on personality valuesevaluate_alignment- Evaluate how well text aligns with personality
For maximum privacy, use Engine mode with a local LLM like Ollama. Your personality data never leaves your machine.
Installation
npm install @idiomark/mcp
Or use directly with npx (no installation required):
npx @idiomark/mcp --file ./me.idiomark
Requirements
- Node.js 18.0.0 or higher
- A Idiomark file (personality blueprint)
Quick Start
Context Mode (Default)
The simplest setup - read-only access to personality data with no LLM required:
import { IdiomarkMCPServer } from '@idiomark/mcp'
const server = new IdiomarkMCPServer({
idiomarkFile: './me.idiomark'
// No llm config = Context mode
})
await server.start()
Engine Mode with Local LLM
For generative capabilities while keeping data on-device:
import { IdiomarkMCPServer } from '@idiomark/mcp'
const server = new IdiomarkMCPServer({
idiomarkFile: './me.idiomark',
mode: {
mode: 'engine',
llm: {
type: 'ollama',
model: 'llama3.2'
}
}
})
await server.start()
Engine Mode with Cloud LLM
For generative capabilities using your own API key:
import { IdiomarkMCPServer } from '@idiomark/mcp'
const server = new IdiomarkMCPServer({
idiomarkFile: './me.idiomark',
mode: {
mode: 'engine',
llm: {
type: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY
}
}
})
await server.start()
When using cloud LLMs (Anthropic, OpenAI), your personality data will be sent to the LLM provider. Only use this option if you accept this data transmission.
CLI Usage
The MCP Server includes a CLI for quick setup and testing.
Basic Commands
# Context mode (automatic)
npx @idiomark/mcp --file ./me.idiomark
# Engine mode (local LLM)
npx @idiomark/mcp --file ./me.idiomark --llm-type ollama
# Engine mode (API key)
npx @idiomark/mcp --file ./me.idiomark --llm-type anthropic --api-key $ANTHROPIC_API_KEY
# HTTP transport
npx @idiomark/mcp --file ./me.idiomark --transport http --port 3000
CLI Options
| Flag | Alias | Description | Default |
|---|---|---|---|
--file | -f | Path to Idiomark file (required) | - |
--transport | -t | Transport type: stdio or http | stdio |
--port | -p | Port for HTTP transport | 3000 |
--llm-type | LLM provider | - | |
--llm-model | -m | Model name | llama3.2 (for ollama) |
--api-key | -k | API key for cloud LLMs | - |
--llm-base-url | Custom base URL for LLM API | - | |
--accept-data-upload | Accept sending data to cloud LLM | false | |
--help | -h | Show help message | - |
Supported LLM Providers
Local LLMs (Privacy-First)
| Provider | Type | Privacy | API Key |
|---|---|---|---|
| Ollama | ollama | Full - data stays local | Not required |
| LM Studio | lmstudio | Full - data stays local | Not required |
| LocalAI | localai | Full - data stays local | Not required |
| Jan | jan | Full - data stays local | Not required |
Cloud LLMs (User's API Key)
| Provider | Type | Privacy | API Key |
|---|---|---|---|
| Anthropic | anthropic | Data sent to provider | Required |
| OpenAI | openai | Data sent to provider | Required |
Claude Desktop Integration
The MCP Server integrates seamlessly with Claude Desktop.
Simple Configuration
Add this to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"my-personality": {
"command": "npx",
"args": [
"-y",
"@idiomark/mcp",
"--file",
"/Users/you/.idiomark/me.idiomark"
]
}
}
}
With Local LLM (Ollama)
For generative capabilities with privacy:
{
"mcpServers": {
"my-personality-engine": {
"command": "npx",
"args": [
"-y",
"@idiomark/mcp",
"--file",
"/Users/you/.idiomark/me.idiomark",
"--llm-type",
"ollama",
"--llm-model",
"llama3.2"
]
}
}
}
With Cloud API Key
For maximum capability:
{
"mcpServers": {
"my-personality-api": {
"command": "npx",
"args": [
"-y",
"@idiomark/mcp",
"--file",
"/Users/you/.idiomark/me.idiomark",
"--llm-type",
"anthropic",
"--api-key",
"${ANTHROPIC_API_KEY}"
],
"env": {
"ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
}
}
}
}
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
API Reference
IdiomarkMCPServer Class
Main server class for creating an MCP server.
Constructor
new IdiomarkMCPServer(config: IdiomarkMCPServerConfig)
Configuration Options
interface IdiomarkMCPServerConfig {
// Path to Idiomark file or IdiomarkFile object
idiomarkFile: string | IdiomarkFile
// Transport type (default: 'stdio')
transport?: 'stdio' | 'http'
// Port for HTTP transport (default: 3000)
port?: number
// Server mode configuration
mode?: ServerModeConfig
// Key provider for encrypted Idiomark files
keyProvider?: () => string | Promise<string>
}
Methods
start()
Start the MCP server.
await server.start()
stop()
Stop the MCP server.
await server.stop()
getTools()
Get available MCP tools based on current mode.
const tools = server.getTools()
getResources()
Get available MCP resources.
const resources = server.getResources()
Mode Configuration Types
ContextModeConfig
interface ContextModeConfig {
mode: 'context'
// Context mode is read-only - no LLM config needed
}
EngineModeConfig
interface EngineModeConfig {
mode: 'engine'
llm: LLMConfig
acceptDataUpload?: boolean // For cloud LLMs
}
LLM Configuration Types
Local LLM:
interface LocalLLMConfig {
type: 'ollama' | 'lmstudio' | 'localai' | 'jan'
model: string
baseUrl?: string
}
Cloud LLM:
interface CloudLLMConfig {
type: 'anthropic' | 'openai'
apiKey: string
model?: string
baseUrl?: string
}
Tool Reference
Context Mode Tools
query_domain
Query domain expertise from personality. Returns confidence score and evidence.
// Input
{
domain: string // Domain name (e.g., "rust", "web-development")
}
// Output
{
found: boolean,
domain: { name: string, confidence: number, evidence: string[] } | null,
message: string
}
check_value_conflict
Check if text conflicts with personality values.
// Input
{
text: string // Text to check against values
}
// Output
{
hasConflict: boolean,
conflicts: Array<{ name: string, sentiment: string }>,
message: string
}
get_voice
Get voice parameters for the personality.
// Input
{} // No parameters required
// Output
{
tone: { primary: string, confidence: number },
formality: number, // 0-1
humor: number, // 0-1
sarcasm: number, // 0-1
enthusiasm: number, // 0-1
directness: number // 0-1
}
get_system_prompt
Get a system prompt for this personality.
// Input
{
mode?: 'strict' | 'balanced' | 'subtle', // default: 'balanced'
includeInstructions?: boolean // default: true
}
// Output: string (system prompt)
Engine Mode Tools (Additional)
generate_response
Generate an AI response with personality applied.
// Input
{
message: string,
mode?: 'strict' | 'balanced' | 'subtle',
context?: Array<{
role: 'user' | 'assistant' | 'system',
content: string
}>
}
// Output: string (generated response)
apply_voice
Transform text to match personality voice while preserving meaning.
// Input
{
text: string,
strength?: number // 0-1, default 1
}
// Output: string (transformed text)
suggest_actions
Suggest actions based on personality values and domains.
// Input
{
situation: string,
options?: string[] // Optional predefined options to consider
}
// Output: string (suggested actions with reasoning)
evaluate_alignment
Evaluate how well text aligns with personality.
// Input
{
text: string,
aspect?: 'voice' | 'values' | 'overall' // default: 'overall'
}
// Output: string (alignment score, strengths, weaknesses, suggestions)
Resource Reference
Access personality data directly via MCP resources:
| URI | Name | Description |
|---|---|---|
idiomark:///personality | Personality | Full Idiomark personality file |
idiomark:///metadata | Metadata | Idiomark file metadata (entity info, extraction details) |
idiomark:///voice | Voice Profile | Voice characteristics |
idiomark:///values | Core Values | Values and principles |
idiomark:///domains | Domain Knowledge | Areas of expertise with confidence scores |
idiomark:///knowledge | Knowledge Graph | Frequent terms, mentions, topics |
idiomark:///patterns | Communication Patterns | Writing patterns (sentence length, emoji usage) |
HTTP Transport
For non-stdio scenarios, use HTTP transport:
const server = new IdiomarkMCPServer({
idiomarkFile: './me.idiomark',
transport: 'http',
port: 3000
})
await server.start()
HTTP Endpoints
| Method | Path | Description |
|---|---|---|
POST | / | JSON-RPC message handler |
GET | /health | Health check endpoint |
Health Check Response
{
"status": "ok",
"server": "idiomark-mcp",
"mode": "context"
}
Security
Encrypted Idiomark Files
Idiomark files can be encrypted for additional security. Keys stay local and data never leaves your machine.
const server = new IdiomarkMCPServer({
idiomarkFile: './me.idiomark.enc',
keyProvider: async () => {
// Return decryption key
return await getKeyFromUser()
}
})
Cloud LLM Data Consent
Using cloud LLMs requires explicit consent:
npx @idiomark/mcp \
--file ./me.idiomark \
--llm-type anthropic \
--api-key $ANTHROPIC_API_KEY \
--accept-data-upload
When using cloud LLMs, you will be warned before data is sent. Only proceed if you understand and accept that your personality data will be transmitted to the LLM provider.
Mode Comparison
| Feature | Context Mode | Engine Mode (Local) | Engine Mode (Cloud) |
|---|---|---|---|
| Privacy | Maximum - data stays local | Maximum - data stays local | Data sent to provider |
| Query Tools | Yes | Yes | Yes |
| Generative Tools | No | Yes | Yes |
| LLM Required | No | Yes (local) | Yes (API key) |
| Response Generation | No | Yes | Yes |
| Voice Transformation | No | Yes | Yes |
| Action Suggestions | No | Yes | Yes |
| Alignment Evaluation | No | Yes | Yes |
Comparison with Similar Tools
| Feature | @idiomark/mcp | Context7 | Clueo |
|---|---|---|---|
| Purpose | Personality context | Code context | Personality engine |
| Data Extraction | 43+ platforms | Codebases | Manual config |
| Open Source | Yes (MIT) | Yes (MIT) | Yes (MIT) |
| MCP Server | Yes | Yes | Yes |
| Local LLM | Yes | No | Yes |
| User's API Key | Yes | No | No |
Architecture
@idiomark/mcp/
+-- src/
| +-- server.ts # Main MCPServer class
| +-- modes/
| | +-- context.ts # Context mode implementation
| | +-- engine.ts # Engine mode implementation
| +-- types.ts # TypeScript types
| +-- cli.ts # CLI entry point
| +-- index.ts # Main exports
+-- package.json
+-- tsconfig.json
+-- tsup.config.ts
+-- README.md
Troubleshooting
Common Issues
Server fails to start:
- Ensure Node.js 18+ is installed
- Verify the Idiomark file path is correct
- Check file permissions
Ollama connection fails:
- Verify Ollama is running:
ollama serve - Check the model is installed:
ollama pull llama3.2 - Verify the base URL (default:
http://localhost:11434)
Cloud LLM authentication fails:
- Verify your API key is valid
- Check environment variable is set correctly
- Ensure you have API credits available
Debug Mode
Enable verbose logging for debugging:
DEBUG=idiomark:* npx @idiomark/mcp --file ./me.idiomark
Resources
- Idiomark GitHub
- Context7 - Inspiration for this project
- MCP Specification - Model Context Protocol docs
- Ollama - Local LLM runtime