
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

An MCP server that stores and retrieves context-specific agent rules, exposing tools for rule discovery, metadata lookup, and content retrieval.
ContextualAgentRulesHub MCP server for agent rules is cataloged as an MCP server attributed to oshvartz. An MCP server that stores and retrieves context-specific agent rules, exposing tools for rule discovery, metadata lookup, and content retrieval. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for ContextualAgentRulesHub MCP server for agent rules are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Without a context filter the server returns only rules without context (general rules); with a context filter it returns rules with no context plus rules matching the provided context.
The architecture supports File, Database, Git Repository, and API sources; the completed implementation includes YAML file support, while database, git, and API sources are listed as future enhancements.
README.md · a563c79e140b · 采集于 2026-11-13 11:00:12 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
ContextualAgentRulesHub is an MCP (Model Context Protocol) server that provides a flexible system for storing and retrieving agent rules that can be used by AI agents to follow context-specific guidelines. The MCP server exposes tools for efficient rule discovery and content retrieval, enabling AI agents to access only the rules relevant to their current task.
Managing agent rules effectively can be challenging. Sharing rules across different agents or projects often leads to inconsistencies and difficulties in maintaining a centralized rule set. Furthermore, AI agents often operate with limited context windows. Sending a large, undifferentiated set of rules can consume valuable context space. AgentRulesHub aims to address these issues by:
is_core flag to identify essential rules, with a dedicated MCP tool (GetCoreRulesContent) to retrieve their content.This section describes the typical flow of an AI agent interacting with the AgentRulesHub MCP server to retrieve and utilize rules for a given task.
GetCoreRulesContent tool. If any core rules exist, their content is retrieved and applied as foundational guidelines for the task.GetAllContexts tool to discover available contexts for more specific rules.rules-hub MCP server using the GetAllRulesMetadata tool, optionally providing a context filter. This provides an index of all non-core rules, including their IDs, descriptions, languages, tags, and contexts.GetRuleContentById tool for each relevant rule ID to fetch its specific content.sequenceDiagram
participant Agent
participant RulesHubServer as "rules-hub MCP Server"
Agent->>RulesHubServer: 1. Request: GetCoreRulesContent
RulesHubServer-->>Agent: 2. Response: Core Rules Content (if any)
Agent->>RulesHubServer: 3. Request: GetAllContexts (Optional)
RulesHubServer-->>Agent: 4. Response: Available Contexts
Agent->>RulesHubServer: 5. Request: GetAllRulesMetadata(contextFilter?)
RulesHubServer-->>Agent: 6. Response: Non-Core Rules Index (Metadata)
Agent->>Agent: 7. Analyze Task & Identify Relevant Non-Core Rules
alt Relevant Non-Core Rules Found
loop For Each Relevant Non-Core Rule
Agent->>RulesHubServer: 8. Request: GetRuleContentById (ruleId)
RulesHubServer-->>Agent: 9. Response: Rule Content
end
end
Agent->>Agent: 10. Utilize All Retrieved Rule Content for Task
The context feature allows you to organize rules for specific projects or domains while maintaining a set of general rules that apply universally.
This ensures that general rules are always available, while context-specific rules are only returned when explicitly requested.
Clone the repository:
git clone <repository-url>
cd ContextualAgentRulesHub
Install dependencies:
pip install -r requirements.txt
Install Python dependencies:
pip install -r mcp-server/requirements.txt
Configure your MCP client (e.g., Claude Desktop, Cline):
Add the following to your MCP settings file:
For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"cotextual-agent-rules-hub": {
"command": "python",
"args": ["C:/path/to/ContextualAgentRulesHub/mcp-server/run_server.py"],
"env": {
"RulesLoaderOptions:0:SourceType": "YamlFile",
"RulesLoaderOptions:0:Path": "C:/path/to/ContextualAgentRulesHub/rules"
}
}
}
}
For Cline VSCode Extension (settings.json):
{
"cline.mcpServers": {
"cotextual-agent-rules-hub": {
"command": "python",
"args": ["C:/path/to/ContextualAgentRulesHub/mcp-server/run_server.py"]
}
}
}
As part of your MCP server configuration, you should add the following optimized custom instruction block that leverages the context and core rules features:
When starting a new task:
1. Always begin by using the cotextual-agent-rules-hub MCP server's GetCoreRulesContent tool to retrieve and apply any foundational core rules.
2. Next, use the GetAllContexts tool to discover available contexts for more specific guidelines.
3. Unless the task explicitly states which context to use, ask the user to select from the available contexts or indicate that none should be used for non-core rules.
4. Use GetAllRulesMetadata with the appropriate contextFilter if the user selected a specific context, or without a filter for general non-core tasks.
5. Review the non-core rules metadata and identify ALL rules relevant to your task based on language, tags, and descriptions.
6. Use GetRuleContentById to retrieve the content of ALL relevant non-core rules.
7. Apply all retrieved rules (core and non-core) throughout your work on the task.
This approach ensures you always have access to fundamental core guidelines, general best practices, and project-specific rules when explicitly requested.
The MCP server can be configured using environment variables:
| Variable | Description | Default |
|---|---|---|
RulesLoaderOptions:0:SourceType | Source type for rules loading | YamlFile |
RulesLoaderOptions:0:Path | Path to rules directory | ./rules |
AGENT_RULES_VALIDATION | Enable rule validation | true |
AGENT_RULES_LOG_LEVEL | Logging level (DEBUG, INFO, WARNING, ERROR) | INFO |
You can configure multiple rule sources by using indexed environment variables. Add additional sources using RulesLoaderOptions:1:, RulesLoaderOptions:2:, etc.
Example with multiple sources:
# First source - Local YAML files
RulesLoaderOptions:0:SourceType=YamlFile
RulesLoaderOptions:0:Path=C:/path/to/ContextualAgentRulesHub/rules
# Second source - Additional rule directory
RulesLoaderOptions:1:SourceType=YamlFile
RulesLoaderOptions:1:Path=C:/path/to/additional/rules
# Third source - Team shared rules
RulesLoaderOptions:2:SourceType=YamlFile
RulesLoaderOptions:2:Path=\\shared\network\path\team-rules
In MCP client configuration:
{
"mcpServers": {
"cotextual-agent-rules-hub": {
"command": "python",
"args": ["C:/path/to/ContextualAgentRulesHub/mcp-server/run_server.py"],
"env": {
"RulesLoaderOptions:0:SourceType": "YamlFile",
"RulesLoaderOptions:0:Path": "C:/path/to/ContextualAgentRulesHub/rules",
"RulesLoaderOptions:1:SourceType": "YamlFile",
"RulesLoaderOptions:1:Path": "C:/path/to/additional/rules"
}
}
}
}
The server exposes the following main tools:
GetCoreRulesContentis_core: true.Example Response:
[
"Core Rule 1 Content...",
"Core Rule 2 Content..."
]
GetAllContextsExample Response:
[
"TheProject",
"mcp-server",
"frontend-app"
]
GetAllRulesMetadatacontextFilter (optional): Filter non-core rules by context.Example Response:
[
{
"ruleId": "csharp-standards-rule",
"description": "This rule checks for adherence to C# coding standards (non-core)",
"language": "csharp",
"tags": ["coding-standards", "best-practices"],
"context": null,
"source": {
"sourceType": "File"
}
},
{
"ruleId": "theproject-python-guidelines",
"description": "Python guidelines specific to TheProject (non-core)",
"language": "python",
"tags": ["python", "theproject"],
"context": "TheProject",
"source": {
"sourceType": "File"
}
}
]
GetRuleContentByIdruleId (string): The unique identifier of the rule.Example Usage:
{
"ruleId": "csharp-standards-rule"
}
RulesLoaderOptions:0:Path points to your rules directorycontext field properly set in YAML filesrules/python-pep8-standards.yaml)id: python-pep8-standards
description: "Python PEP8 coding standards and formatting guidelines"
language: python
context: null # Optional: null for general rules, or specify a context like "TheProject"
is_core: false # Optional: true if this is a core rule, defaults to false.
# 'coreRule' is also supported for backward compatibility.
tags:
- coding-standards
- pep8
- formatting
- best-practices
rule: |
# Python PEP8 Standards Guide
## Indentation
- Use 4 spaces per indentation level
- Never mix tabs and spaces
## Line Length
- Limit all lines to a maximum of 79 characters
[... detailed rule content ...]
id: theproject-api-guidelines
description: "API development guidelines specific to TheProject"
language: python
context: TheProject # This rule only appears when context filter is "TheProject"
tags:
- api
- theproject
- rest
- guidelines
rule: |
# TheProject API Development Guidelines
## API Versioning
- All APIs must use semantic versioning
- Version must be included in URL path: /api/v1/
[... TheProject-specific guidelines ...]
Implement the RuleSource interface:
from src.sources.base import RuleSource
class CustomSource(RuleSource):
def load_rules_metadata(self) -> List[Rule]:
# Implementation
pass
def load_rule_content(self, rule_id: str) -> str:
# Implementation
pass
def validate_source(self) -> bool:
# Implementation
pass
Register with the repository:
custom_source = CustomSource(config)
repository.add_source(custom_source)
✅ Completed Features:
✅ MCP Tools Available:
GetAllContexts: Discover available contextsGetAllRulesMetadata: Retrieve rule index for discovery with optional context filtering (excludes core rules).GetRuleContentById: Get specific rule content by ID.GetCoreRulesContent: Retrieve content for all rules marked as is_core: true.The ContextualAgentRulesHub can also be effectively used as a centralized system for managing and distributing custom instructions for AI agents. By defining custom instructions as rules (potentially marked with is_core: true if they are fundamental), agents can dynamically fetch and apply the latest instructions relevant to their tasks or contexts. This approach offers several advantages:
This turns the rule hub into a powerful "instruction bank" for your AI agents.
🔄 Future Enhancements:
[License information to be added]
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for ContextualAgentRulesHub MCP server for agent rules from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/contextualagentruleshub)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.