MCP.so
登录

ContextualAgentRulesHub

@oshvartz

关于 ContextualAgentRulesHub

MCP (Model Context Protocol) server designed to manage and provide contextual rules for AI agents

基本信息

分类

其他

许可证

Apache-2.0

运行时

python

传输方式

stdio

发布者

oshvartz

配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is ContextualAgentRulesHub?

ContextualAgentRulesHub is an MCP (Model Context Protocol) server that provides a flexible system for storing and retrieving agent rules, enabling AI agents to follow context-specific guidelines. It exposes tools for efficient rule discovery and content retrieval, allowing agents to access only the rules relevant to their current task, minimizing context window usage. Designed for developers using MCP clients such as Claude Desktop or the Cline VSCode extension.

How to use ContextualAgentRulesHub?

Configure the MCP client by pointing its command and environment variables to the run_server.py script and a rules directory. Once running, agents follow a typical task flow: start by retrieving core rules via GetCoreRulesContent, then discover available contexts with GetAllContexts (optional), obtain non-core rule metadata via GetAllRulesMetadata with an optional context filter, and finally fetch individual rule content using GetRuleContentById. No separate installation step beyond pip install -r requirements.txt is needed.

Key features of ContextualAgentRulesHub

  • Context-based rule organization for project-specific guidelines
  • Multi-source support (File, Database, Git Repository, API)
  • YAML-based human-readable rule storage
  • Efficient indexing by language, tags, context, and content
  • Lazy loading of rule content for optimal performance
  • Flexible querying with AND/OR tag logic
  • Core rules with dedicated retrieval tool (GetCoreRulesContent)

Use cases of ContextualAgentRulesHub

  • General development: retrieve only universal coding standards without context filtering
  • Project-specific work: filter rules by a project name (e.g., "TheProject") to combine general and project guidelines
  • MCP server development: use context "mcp-server" to get MCP-specific standards alongside general rules
  • Cross-team rule sharing: load additional rule directories from a shared network path
  • Reducing agent context length by retrieving only rules relevant to the current task

FAQ from ContextualAgentRulesHub

What is the difference between core and non-core rules?

Core rules are marked with is_core: true and are retrieved via GetCoreRulesContent at task start to provide foundational guidelines. Non-core rules are context-specific and retrieved via GetAllRulesMetadata with an optional context filter; their content is fetched on demand using GetRuleContentById.

What dependencies are required to run the server?

The server requires Python 3 and the packages listed in mcp-server/requirements.txt (installed via pip install -r requirements.txt).

How does context filtering work?

When no context filter is provided, only rules without a context (general rules) are returned. When a context is specified, both general rules and rules matching that context are returned. This ensures project-specific guidelines are only retrieved when explicitly requested.

Can rules be loaded from multiple sources?

Yes. Use indexed environment variables (e.g., RulesLoaderOptions:0:SourceType, RulesLoaderOptions:0:Path for the first source, :1: for the second, etc.). Each source can be a local YAML directory or a network path.

Is rule validation supported?

Yes. Set the environment variable AGENT_RULES_VALIDATION to true (default) to enable validation of rule files during loading.

评论

其他 分类下的更多 MCP 服务器