mcp-tool-authoring

mcp-tool-authoring is a skill for Claude Code, Codex from kouroshez/coding-os. It costs 145 tokens per session (3,163 once invoked), scanned A, original, Apache-2.0.

A set of rules for creating Model Context Protocol tools, which let an AI agent call functions exposed by a server.

In plain words
What is it for?
Use it when adding or changing MCP tools in the repository's thinking, graph, board, or web-route code.
Why use it?
It helps new tools use the repository's required names, response envelope, registration process, and documentation workflow.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is - **Source:** [`src/core/thinking_os/tools/<module>.py::cos_my_new_tool`](../../core/thinking_os/tools/<module>.py).

Good fit Use it when adding or changing MCP tools in the repository's thinking, graph, board, or web-route code.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os
agentmods
npx agentmods add skills/kouroshez/coding-os/mcp-tool-authoring

Made for: Claude Code, Codex.

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-tool-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring/github.svg)](https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring)
Your own site
<a href="https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring/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-tool-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,163 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00145 $0.03163
Opus 5 $0.00072 $0.01581
Sonnet 5 $0.00029 $0.00633
Haiku 4.5 $0.00015 $0.00316

Measured 5d ago against content hash c73d26a7b23f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

mcp-tool-authoring scanned grade A with 0 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/new_tool.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/templates/meta/skills/mcp-tool-authoring/SKILL.md · 302 lines

How it starts

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

mcp-tool-authoring

Purpose: Make every new cos_* MCP tool match the contract every other tool follows. Drift here breaks the agent (deferred-tool schema lookups), the envelope (Rule 13), or the migration (Rule 9). One canonical authoring path keeps the ~80 tools coherent.

Read when: editing files matching:

  • src/core/thinking_os/tools/*.py — MCP tools registered with the FastMCP server.
  • src/core/graph_os/tools/*.py — graph-side tools (cos_graph_*).
  • src/core/board_os/mcp_tools.py — Scrumban / task tools.
  • src/core/web/routes/*.py — HTTP routes that wrap an MCP tool for the Hub UI.
  • src/core/thinking_os/server.py — when registering a new tool module.

Skip when: editing tests, helpers, or non-tool internals.

The Five Hard Contracts

Every cos_* tool MUST satisfy ALL of:

1. Name prefix cos_ (Rule 2)

@mcp.tool
@safe_tool
async def cos_search(query: str, limit: int = 5) -> dict:
    ...

Names without the cos_ prefix are silently rejected from the tool inventory. The inventory is the SSOT for docs/governance/mcp-tool-inventory.md (regenerated, not hand-edited).

2. Envelope shape via @safe_tool (Rule 13)

Every tool returns ok(data) or fail(category, message). The decorator does this for you:

from core.thinking_os.tools._shared import safe_tool, ok, fail

@mcp.tool
@safe_tool  # converts raw exceptions to fail() envelopes
async def cos_search(query: str, limit: int = 5) -> dict:
    if not query:
        return fail("invalid_input", "query is required")

    rows = await _db.search(query, limit=limit)
    return ok({"results": rows, "count": len(rows), "meta": {"layer": "memory"}})

fail categories are documented in docs/engineering/mcp-error-envelope.md: invalid_input, not_found, unavailable, permission_denied, internal_error, rate_limited. Don't invent new categories without updating the contract doc.

3. ONE-line docstring (Rule 12)

Read the full file on GitHub · 302 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 302 lines · 145 tokens per session scan A c73d26a7b23f

Subscribe to this mod's changes

mcp-tool-authoring is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 145 tokens to every session and 3,163 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

potpie-graph

Use when the task can read or write the project-memory graph through the potpie CLI: discover the contract with graph catalog, read named views with graph read, resolve entity identity with graph search-entities, create validated plans with graph propose, commit plans with graph commit --verify, inspect quality with…

potpie-ai/potpie · 94 tokens

potpie-source-ingestion

Use when the user explicitly asks to ingest, refresh, or deeply understand a repository, PR, issue, ticket, runbook, incident report, document, or web link into Potpie. The harness performs todo-driven discovery, uses local/GitHub/integration tools and read-only subagents when available, builds evidence-backed…

potpie-ai/potpie · 82 tokens

potpie-repo-baseline

Use when establishing, refreshing, or deeply understanding a repository's baseline memory in Potpie: purpose, application type, features, services/modules, environments, deploy shape, dependencies, API contracts, datastores, integrations, ownership, and explicit preferences. The harness reads authored and…

potpie-ai/potpie · 75 tokens

graph-mutation-plan

Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.

potpie-ai/potpie · 51 tokens

potpie-cli

Use when the task is centered on running, explaining, configuring, or troubleshooting the potpie command: doctor, login, pot management, source registration, search, graph workbench reads/writes, and pot scope behavior.

potpie-ai/potpie · 50 tokens

potpie-change-timeline

Use when an agent needs recent or historical change context: what changed recently, regressions, merged PRs, tickets, docs, incidents, deployments, releases, and source-history ingestion.

potpie-ai/potpie · 43 tokens