clare: Skill for Codex

.codex/skills/mcp-server/SKILL.md

mcp-server is a skill for Codex from jketreno/clare. It costs 17 tokens per session (2,842 once invoked), scanned A, original, MIT.

A setup workflow for creating an MCP server, a small service that lets compatible coding agents call tools, for CLARE's verification and file-permission checks.

In plain words
What is it for?
Use it to scaffold a runnable server exposing CI verification, autonomy checks for file paths, and a list of files restricted to human editing.
Why use it?
It makes the project's automated checks available to agents and orchestrators that cannot directly use its shell scripts or project-specific instructions.

Skill for Codex

Written for Codex: installed under .codex/. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

This is jketreno/clare's own configuration. It tells Codex how to work on clare 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 clare configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is pip install -r mcp/requirements.txt && echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | python mcp/clare_server.py.

Reuse

Borrowing it

Nothing to install: this file belongs to jketreno/clare. 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/jketreno/clare/main/.codex/skills/mcp-server/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jketreno/clare

Made for: 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-server

README.md
[![agentmods](https://agentmods.dev/badge/skills/jketreno/clare/mcp-server.svg)](https://agentmods.dev/skills/jketreno/clare/mcp-server)
Your own site
<a href="https://agentmods.dev/skills/jketreno/clare/mcp-server"><img src="https://agentmods.dev/badge/skills/jketreno/clare/mcp-server.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,842 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00017 $0.02842
Opus 5 $0.00009 $0.01421
Sonnet 5 $0.00003 $0.00568
Haiku 4.5 $0.00002 $0.00284

Measured 7d ago against content hash 751c33cde387, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

mcp-server scanned grade A with 1 finding 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 7d 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.

Runs shell commandslowCapability

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

import { execSync } from 'child_process';
.codex/skills/mcp-server/SKILL.md · 363 lines

How it starts

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

CLARE MCP Server

What this skill does: Scaffolds a minimal MCP (Model Context Protocol) server that exposes CLARE's enforcement primitives — verify-ci.sh and autonomy.yml — as typed tool calls. Any MCP-compatible agent or orchestrator can then call CLARE tools without needing bash access or CLARE-specific prompt engineering.

When to use: When running multi-agent pipelines, headless agents, or any workflow where you need CLARE enforcement available as a structured tool rather than a bash script.

Output: A mcp/ directory containing a runnable MCP server + registration instructions.


Context

CLARE's two core enforcement primitives are:

  1. clare/verify-ci.sh — runs all CI checks, exits non-zero on failure
  2. clare/autonomy.yml — YAML file mapping file paths to autonomy levels

This skill exposes them as three MCP tools:

Tool Input Output
clare_verify (none) {status, passed[], failed[{check, output}], summary}
clare_check_autonomy {path: string} {path, matched_rule, level, reason}
clare_list_humans_only (none) {humans_only_paths: string[]}

Instructions

When this skill is invoked, generate a CLARE MCP server for the current project.

Step 1: Detect the project runtime

Check for package.json → generate Node.js server. Check for pyproject.toml or requirements.txt → generate Python server. If both exist, ask the user which runtime to use. If neither, default to Node.js.

Step 2: Scaffold the server

For Node.js — create mcp/clare-server.js:

#!/usr/bin/env node
// @generated — regenerate from clare/templates/skills/mcp-server.md, do not hand-edit
//
// CLARE MCP Server
// Exposes CLARE enforcement primitives as MCP tool calls.
// See docs/agentic.md for usage in multi-agent pipelines.

import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
import { execSync } from 'child_process';
import { readFileSync } from 'fs';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import yaml from 'js-yaml';

const __dirname = dirname(fileURLToPath(import.meta.url));
const PROJECT_ROOT = resolve(__dirname, '..');

const server = new Server(
  { name: 'clare', version: '1.0.0' },
  { capabilities: { tools: {} } }
);

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: 'clare_verify',
      description: 'Run clare/verify-ci.sh and return structured pass/fail results. Call this after any code generation before reporting work complete.',
      inputSchema: { type: 'object', properties: {}, required: [] }
    },
    {
      name: 'clare_check_autonomy',
      description: 'Look up the autonomy level for a file path in clare/autonomy.yml. Call this before modifying any file.',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: 'File path relative to project root' }
        },
        required: ['path']
      }
    },
    {
      name: 'clare_list_humans_only',
      description: 'List all humans-only paths from clare/autonomy.yml. Call this as a pre-flight check before delegating tasks to sub-agents.',
      inputSchema: { type: 'object', properties: {}, required: [] }
    }
  ]
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  const { name, arguments: args } = request.params;

  if (name === 'clare_verify') {
    try {
      const output = execSync(`${PROJECT_ROOT}/clare/verify-ci.sh`, {
        cwd: PROJECT_ROOT,
        encoding: 'utf8',
        stdio: ['pipe', 'pipe', 'pipe']
      });
      return {
        content: [{ type: 'text', text: JSON.stringify({ status: 'passed', output, summary: 'All checks passed' }) }]
      };
    } catch (err) {
      const output = err.stdout + err.stderr;
      const failedChecks = (output.match(/❌ (.+)/g) || []).map(l => l.replace('❌ ', '').trim());
      return {
        content: [{ type: 'text', text: JSON.stringify({ status: 'failed', failed: failedChecks, output, summary: `${failedChecks.length} check(s) failed` }) }]
      };
    }
  }

  if (name === 'clare_check_autonomy') {
    const targetPath = args.path;
    const autonomyFile = readFileSync(`${PROJECT_ROOT}/clare/autonomy.yml`, 'utf8');
    const autonomy = yaml.load(autonomyFile);
    
    const modules = autonomy.modules || [];
    let matched = modules.find(m => m.path !== '*' && targetPath.startsWith(m.path));
    if (!matched) matched = modules.find(m => m.path === '*');
    
    return {
      content: [{
        type: 'text',
        text: JSON.stringify({
          path: targetPath,
          matched_rule: matched?.path || 'none',
          level: matched?.level || 'unknown',
          reason: matched?.reason || ''
        })
      }]
    };
  }

  if (name === 'clare_list_humans_only') {
    const autonomyFile = readFileSync(`${PROJECT_ROOT}/clare/autonomy.yml`, 'utf8');
    const autonomy = yaml.load(autonomyFile);
    const humansOnly = (autonomy.modules || [])
      .filter(m => m.level === 'humans-only')
      .map(m => m.path);
    return {
      content: [{ type: 'text', text: JSON.stringify({ humans_only_paths: humansOnly }) }]
    };
  }

  throw new Error(`Unknown tool: ${name}`);
});

const transport = new StdioServerTransport();
await server.connect(transport);

Read the full file on GitHub · 363 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. 7d ago First seen · 363 lines · 17 tokens per session scan A 751c33cde387

Subscribe to this mod's changes

mcp-server is a skill published in the GitHub repository jketreno/clare (5 stars, last pushed 1mo ago), licensed MIT. It adds 17 tokens to every session and 2,842 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

migrate-segw-to-rap

Reverse-engineer a SEGW-built OData V2 service (MPC/DPC/MPCEXT/DPCEXT) into a modern RAP V4 service — tables, CDS views (interface + projection), behavior definitions, draft entities, service definition + binding. Use when asked to "migrate this SEGW service to RAP", "convert OData V2 to V4 RAP", "modernize this…

arc-mcp/arc-1 · 106 tokens

telnyx-messaging-hosted-curl

Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.

team-telnyx/ai · 45 tokens