Navigation
Role-Specific Context MCP Server: Productivity, Error Reduction - MCP Implementation

Role-Specific Context MCP Server: Productivity, Error Reduction

Tailored for every role, this MCP server boosts productivity, cuts errors—your team’s new must-have. No more generic, one-size-fits-all tech." )

Developer Tools
4.1(159 reviews)
238 saves
111 comments

Users create an average of 21 projects per month with this tool

About Role-Specific Context MCP Server

What is Role-Specific Context MCP Server: Productivity, Error Reduction?

This server is a specialized Model Context Protocol (MCP) system designed to streamline AI agent operations by enforcing strict role-based boundaries. It ensures agents like Marketing Experts, Songwriters, or Executive Assistants operate within defined knowledge domains, maintain role-specific memory, and adapt communication styles dynamically. By isolating contextual data and enforcing role-specific instructions, it minimizes errors caused by cross-role confusion and maximizes task-focused productivity.

How to Use Role-Specific Context MCP Server: Productivity, Error Reduction?

Implementation involves three core steps:

  1. Setup: Install dependencies using Node.js 18+, configure the OpenAI API key, and build the project via npm.
  2. Role Configuration: Define roles with tailored instructions, tone profiles, and domain expertise through the provided tools or config file.
  3. Query Execution: Use the HTTP API or MCP tools to process requests with specific roles, appending custom instructions if needed.

For example, a marketing query could be routed to the "marketing-expert" role with B2B-specific parameters, ensuring responses align with target strategies.

Role-Specific Context MCP Server Features

Key Features of Role-Specific Context MCP Server: Productivity, Error Reduction?

Role Management

Dynamic creation of roles with system prompts, domain restrictions, and tone profiles (e.g., technical vs. witty). Predefined roles reduce configuration time for common use cases.

Memory Isolation

Role-specific memory storage with TTL expiration and size limits prevents data leakage between roles. Memories are retrieved contextually, ensuring responses stay role-relevant.

MCP Integration

Expose roles as resources, utilize tools like process-with-role, and leverage role-based prompts to standardize interactions across agents.

Use Cases of Role-Specific Context MCP Server: Productivity, Error Reduction?

  • Enterprise Support: Route customer inquiries to role-specific agents (e.g., "Legal Advisor" for compliance questions).
  • Creative Workflows: Assign "Songwriter" roles with genre-specific memory to maintain stylistic consistency in outputs.
  • Multi-Agent Collaboration: Prevent role overlap in projects where an "Executive Assistant" coordinates with "Project Manager" agents.
  • Compliance Control: Enforce strict domain boundaries for regulated industries, ensuring agents don’t cross into unauthorized knowledge areas.

Role-Specific Context MCP Server FAQ

FAQ from Role-Specific Context MCP Server: Productivity, Error Reduction?

How do I start with minimal configuration?

Use the default roles and modify src/config.ts for memory limits and tones. The starter kit includes common profiles like "Marketing Expert" and "Technical Writer."

Can I override default tones temporarily?

Yes, the change-role-tone tool allows runtime adjustments. For example, switching a "Customer Support" role to a more empathetic tone during crisis management.

What happens if memory limits are exceeded?

Oldest memories are purged first. Configure memory.maxEntriesPerRole in the config to balance retention needs against performance constraints.

Is cross-role data sharing possible?

Intentionally disabled by design. To merge roles, use the update-role tool to append domains or instructions from another role’s configuration.

Content

Role-Specific Context MCP Server

A Model Context Protocol (MCP) server that defines and governs contextual boundaries based on agent roles in your system.

Overview

This MCP server enables role-based context management for AI agents, allowing you to:

  • Establish clear instructions, objectives, and domain knowledge for each AI agent (Marketing Expert, Songwriter, Executive Assistant, etc.)
  • Keep role-relevant memory partitioned and scoped, preventing cross-contamination between different agent roles
  • Adapt tone and style dynamically (serious, witty, sarcastic) per role, with tone profiles baked into the prompt

Features

Role Management

  • Create, update, and delete custom roles
  • Pre-defined roles with specific expertise domains
  • Role-specific system prompts and instructions
  • Customizable tone profiles

Memory Management

  • Role-specific memory storage
  • Memory retrieval based on relevance to current query
  • Time-to-live (TTL) for memories
  • Memory limits per role

MCP Integration

  • Exposes roles as MCP resources
  • Provides tools for role management and query processing
  • Offers prompts for role-based interactions

Getting Started

Prerequisites

  • Node.js 18+
  • OpenAI API key

Installation

# Clone the repository
git clone https://github.com/yourusername/role-context-mcp.git
cd role-context-mcp

# Install dependencies
npm install

# Set up environment variables
echo "OPENAI_API_KEY=your_api_key_here" > .env

# Build the project
npm run build

Running the Server

# Run the MCP server
npm start

# Run the HTTP server for testing
npm run start:http

Configuration

The server can be configured by modifying src/config.ts. Key configuration options include:

  • Default roles and their properties
  • Available tone profiles
  • Memory management settings
  • OpenAI model selection

MCP Integration

Resources

The server exposes the following resources:

  • role://{roleId} - Information about a specific role
  • role://tones - Available tone profiles

Tools

The server provides the following tools:

  • process-with-role - Process a query using a specific role
  • create-role - Create a new role
  • update-role - Update an existing role
  • delete-role - Delete a custom role
  • change-role-tone - Change the tone of a role
  • store-memory - Store a memory for a specific role
  • clear-role-memories - Clear all memories for a role

Prompts

The server provides the following prompts:

  • role-{roleId} - Use a specific role to process a request
  • create-custom-role - Create a new custom role

Example Usage

Processing a Query with a Role (MCP)

// Example of using the process-with-role tool
const result = await client.executeToolRequest({
  name: 'process-with-role',
  parameters: {
    roleId: 'marketing-expert',
    query: 'How can I improve my social media engagement?',
    customInstructions: 'Focus on B2B strategies'
  }
});

Processing a Query with a Role (HTTP API)

// Example of using the HTTP API
const response = await axios.post('http://localhost:3000/process', {
  roleId: 'marketing-expert',
  query: 'How can I improve my social media engagement?',
  customInstructions: 'Focus on B2B strategies'
});

console.log(response.data.response);

Creating a Custom Role

// Example of using the create-role tool
const result = await client.executeToolRequest({
  name: 'create-role',
  parameters: {
    id: 'tech-writer',
    name: 'Technical Writer',
    description: 'Specializes in clear, concise technical documentation',
    instructions: 'Create documentation that is accessible to both technical and non-technical audiences',
    domains: ['technical-writing', 'documentation', 'tutorials'],
    tone: 'technical',
    systemPrompt: 'You are an experienced technical writer with expertise in creating clear, concise documentation for complex systems.'
  }
});

License

MIT

Related MCP Servers & Clients