Skip to main content

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 personality
  • check_value_conflict - Check if text conflicts with personality values
  • get_voice - Get voice parameters (tone, formality, humor, etc.)
  • get_system_prompt - Get system prompt for this personality

Available Resources:

  • idiomark:///personality - Full Idiomark personality file
  • idiomark:///metadata - Idiomark file metadata
  • idiomark:///voice - Voice characteristics
  • idiomark:///values - Core values and principles
  • idiomark:///domains - Domain expertise areas
  • idiomark:///knowledge - Knowledge graph
  • idiomark:///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 applied
  • apply_voice - Transform text to match personality voice
  • suggest_actions - Suggest actions based on personality values
  • evaluate_alignment - Evaluate how well text aligns with personality
Privacy First

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()
Data Transmission

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​

FlagAliasDescriptionDefault
--file-fPath to Idiomark file (required)-
--transport-tTransport type: stdio or httpstdio
--port-pPort for HTTP transport3000
--llm-typeLLM provider-
--llm-model-mModel namellama3.2 (for ollama)
--api-key-kAPI key for cloud LLMs-
--llm-base-urlCustom base URL for LLM API-
--accept-data-uploadAccept sending data to cloud LLMfalse
--help-hShow help message-

Supported LLM Providers​

Local LLMs (Privacy-First)​

ProviderTypePrivacyAPI Key
OllamaollamaFull - data stays localNot required
LM StudiolmstudioFull - data stays localNot required
LocalAIlocalaiFull - data stays localNot required
JanjanFull - data stays localNot required

Cloud LLMs (User's API Key)​

ProviderTypePrivacyAPI Key
AnthropicanthropicData sent to providerRequired
OpenAIopenaiData sent to providerRequired

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}"
}
}
}
}
Config File Locations
  • 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:

URINameDescription
idiomark:///personalityPersonalityFull Idiomark personality file
idiomark:///metadataMetadataIdiomark file metadata (entity info, extraction details)
idiomark:///voiceVoice ProfileVoice characteristics
idiomark:///valuesCore ValuesValues and principles
idiomark:///domainsDomain KnowledgeAreas of expertise with confidence scores
idiomark:///knowledgeKnowledge GraphFrequent terms, mentions, topics
idiomark:///patternsCommunication PatternsWriting 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​

MethodPathDescription
POST/JSON-RPC message handler
GET/healthHealth 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()
}
})

Using cloud LLMs requires explicit consent:

npx @idiomark/mcp \
--file ./me.idiomark \
--llm-type anthropic \
--api-key $ANTHROPIC_API_KEY \
--accept-data-upload
Important

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​

FeatureContext ModeEngine Mode (Local)Engine Mode (Cloud)
PrivacyMaximum - data stays localMaximum - data stays localData sent to provider
Query ToolsYesYesYes
Generative ToolsNoYesYes
LLM RequiredNoYes (local)Yes (API key)
Response GenerationNoYesYes
Voice TransformationNoYesYes
Action SuggestionsNoYesYes
Alignment EvaluationNoYesYes

Comparison with Similar Tools​

Feature@idiomark/mcpContext7Clueo
PurposePersonality contextCode contextPersonality engine
Data Extraction43+ platformsCodebasesManual config
Open SourceYes (MIT)Yes (MIT)Yes (MIT)
MCP ServerYesYesYes
Local LLMYesNoYes
User's API KeyYesNoNo

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​