Role-Specific Context MCP Server
角色特定上下文 MCP 服务器
模型上下文协议 (MCP) 服务器根据系统中的代理角色定义和管理上下文边界。
概述
该 MCP 服务器支持 AI 代理的基于角色的上下文管理,允许您:
为每个 AI 代理(营销专家、词曲作者、行政助理等)制定明确的指示、目标和领域知识
保持与角色相关的内存分区和范围,防止不同代理角色之间的交叉污染
根据角色动态调整语气和风格(严肃、诙谐、讽刺),并将语气特征融入提示中
Related MCP server: CodeAlive MCP
特征
角色管理
创建、更新和删除自定义角色
具有特定专业领域的预定义角色
特定角色的系统提示和说明
可定制的音调配置文件
内存管理
角色特定的记忆存储
根据与当前查询的相关性进行记忆检索
记忆的生存时间(TTL)
每个角色的内存限制
MCP 集成
将角色公开为 MCP 资源
提供角色管理和查询处理工具
提供基于角色的交互提示
入门
先决条件
Node.js 18+
OpenAI API 密钥
安装
# 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运行服务器
# Run the MCP server
npm start
# Run the HTTP server for testing
npm run start:http配置
可以通过修改src/config.ts来配置服务器。关键配置选项包括:
默认角色及其属性
可用的音调配置文件
内存管理设置
OpenAI模型选择
MCP 集成
资源
服务器公开以下资源:
role://{roleId}- 有关特定角色的信息role://tones- 可用的音调配置文件
工具
该服务器提供以下工具:
process-with-role- 使用特定角色处理查询create-role创建新角色update-role- 更新现有角色delete-role- 删除自定义角色change-role-tone- 改变角色基调store-memory- 为特定角色存储记忆clear-role-memories- 清除角色的所有记忆
提示
服务器给出如下提示:
role-{roleId}- 使用特定角色来处理请求create-custom-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'
}
});使用角色处理查询(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);创建自定义角色
// 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.'
}
});执照
麻省理工学院
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI agents with persistent memory capabilities through Mem0, allowing them to store, retrieve, and semantically search memories.679MIT

CodeAlive MCPofficial
AlicenseNot gradedqualityAmaintenanceA Model Context Protocol server that enhances AI agents by providing deep semantic understanding of codebases, enabling more intelligent interactions through advanced code search and contextual awareness.88MIT- AlicenseNot gradedqualityDmaintenanceA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.1011MIT
- FlicenseBqualityDmaintenanceA Model Context Protocol server that provides persistent memory capabilities for AI systems, enabling true continuity of consciousness across conversations through episodic, semantic, procedural, and strategic memory types.246
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Connect AI agents to Replynodes over the Model Context Protocol.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Chris-June/MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server