ai-counsel: Skill for Claude Code

.claude/skills/mcp-server-enhancement/SKILL.md

mcp-server-enhancement is a skill for Claude Code from blueman82/ai-counsel. It costs 18 tokens per session (5,382 once invoked), scanned B, original, MIT.

A guide for extending an AI Counsel server with new MCP tools. MCP is a standard way for an AI assistant to call tools provided by another program.

In plain words
What is it for?
Use it when adding tools to the server, including request and response validation, asynchronous handlers, error responses, and stdio protocol handling.
Why use it?
It helps prevent common server problems involving invalid messages, unsafe logging, failed requests, and incorrect data types.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is blueman82/ai-counsel's own configuration. It tells Claude Code how to work on ai-counsel itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-counsel configures →

Reuse

Borrowing it

Nothing to install: this file belongs to blueman82/ai-counsel. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/blueman82/ai-counsel/main/.claude/skills/mcp-server-enhancement/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/blueman82/ai-counsel

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-server-enhancement

README.md
[![agentmods](https://agentmods.dev/badge/skills/blueman82/ai-counsel/mcp-server-enhancement/github.svg)](https://agentmods.dev/skills/blueman82/ai-counsel/mcp-server-enhancement)
Your own site
<a href="https://agentmods.dev/skills/blueman82/ai-counsel/mcp-server-enhancement"><img src="https://agentmods.dev/badge/skills/blueman82/ai-counsel/mcp-server-enhancement/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-server-enhancement

Your own site · 80×15
<a href="https://agentmods.dev/skills/blueman82/ai-counsel/mcp-server-enhancement"><img src="https://agentmods.dev/badge/skills/blueman82/ai-counsel/mcp-server-enhancement.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,382 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.05382
Opus 5 $0.00009 $0.02691
Sonnet 5 $0.00004 $0.01076
Haiku 4.5 $0.00002 $0.00538

Measured 10d ago against content hash 18a1c1185166, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

mcp-server-enhancement scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Add your server to `~/.claude/config/mcp.json`:

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
.claude/skills/mcp-server-enhancement/SKILL.md · 760 lines

How it starts

The opening of the file, as written. The whole thing — 760 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP Server Enhancement Skill

This skill provides a systematic approach to extending the AI Counsel MCP server (server.py) with new tools while maintaining protocol compliance, stdio safety, and proper error handling.

Architecture Overview

The AI Counsel MCP server communicates via stdio (stdin/stdout) using the Model Context Protocol. Key architectural constraints:

  • Stdio Safety: stdout is RESERVED for MCP protocol JSON. All logging MUST go to file (mcp_server.log) or stderr
  • Protocol Compliance: Tools must follow MCP specification for request/response format
  • Type Safety: Use Pydantic models for all request/response validation
  • Error Isolation: Tool failures should return structured error responses, not crash the server
  • Async First: All tool handlers are async functions using asyncio

Current Tool Architecture

Tool 1: deliberate (Primary Tool)

  • Purpose: Multi-round AI model deliberation with consensus building
  • Handler: call_tool() function (lines 242-327 in server.py)
  • Request Model: DeliberateRequest (models/schema.py)
  • Response Model: DeliberationResult (models/schema.py)
  • Engine: Uses DeliberationEngine.execute() for orchestration

Tool 2: query_decisions (Decision Graph Tool)

  • Purpose: Search and analyze past deliberations in decision graph memory
  • Handler: handle_query_decisions() function (lines 329-415 in server.py)
  • Request Schema: Inline in list_tools() (lines 196-237)
  • Response: Custom JSON structure (not a Pydantic model)
  • Conditional: Only exposed if config.decision_graph.enabled == True

Step-by-Step: Adding a New MCP Tool

Step 1: Define Pydantic Request/Response Models

Location: models/schema.py

Create type-safe models for your tool's inputs and outputs:

# In models/schema.py

class NewToolRequest(BaseModel):
    """Model for new_tool request."""

    parameter1: str = Field(
        ...,
        min_length=1,
        description="Description of parameter1"
    )
    parameter2: int = Field(
        default=5,
        ge=1,
        le=10,
        description="Integer parameter with range validation"
    )
    optional_param: Optional[str] = Field(
        default=None,
        description="Optional parameter"
    )

class NewToolResponse(BaseModel):
    """Model for new_tool response."""

    status: Literal["success", "partial", "failed"] = Field(
        ...,
        description="Operation status"
    )
    result_data: str = Field(..., description="Main result data")
    metadata: dict = Field(default_factory=dict, description="Additional metadata")

Read the full file on GitHub · 760 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 760 lines · 18 tokens per session scan B 18a1c1185166

Subscribe to this mod's changes

mcp-server-enhancement is a skill published in the GitHub repository blueman82/ai-counsel (1 stars, last pushed 4mo ago), licensed MIT. It adds 18 tokens to every session and 5,382 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.