Skip to content

Latest commit

 

History

History
366 lines (266 loc) · 9.89 KB

File metadata and controls

366 lines (266 loc) · 9.89 KB

MCP Server Integration

SkillForge exposes a Model Context Protocol (MCP) server so any MCP-capable coding agent can invoke all package management operations directly: installing skills mid-session, listing what's available, validating skill quality, and generating suggestions.

The server is agent-agnostic. It communicates over stdio and speaks plain MCP, so Claude Code, Codex, Cursor, Windsurf, Zed, and any other MCP client all work the same way. All tools except skillforge_suggest are pure package-management operations (filesystem + registry) and call no LLM; their behavior is identical regardless of which agent invokes them. Only skillforge_suggest reaches an LLM, and only it needs an API key.


Setup

1. Install SkillForge

npm install -g skillforge

Or from source:

git clone https://github.com/danbenba/skillforge.git
cd skillforge
npm install && npm run build
npm link

2. Register the server with your agent

The server is launched with skillforge mcp (a stdio server). Point your agent's MCP config at that command.

Claude Code: .mcp.json in the project root, or the global ~/.claude/mcp.json:

{
  "mcpServers": {
    "skillforge": {
      "command": "skillforge",
      "args": ["mcp"]
    }
  }
}

Codex: ~/.codex/config.toml:

[mcp_servers.skillforge]
command = "skillforge"
args = ["mcp"]

The ANTHROPIC_API_KEY environment variable is only needed if you use the skillforge_suggest tool. Add it via the config's env block:

{
  "mcpServers": {
    "skillforge": {
      "command": "skillforge",
      "args": ["mcp"],
      "env": {
        "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
      }
    }
  }
}
# Codex equivalent
[mcp_servers.skillforge]
command = "skillforge"
args = ["mcp"]
env = { ANTHROPIC_API_KEY = "sk-ant-..." }

To point skillforge_suggest at a custom Anthropic-compatible endpoint instead, set ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and optionally SKILLPM_SUGGEST_MODEL in the same env block. See suggest.md.

3. Restart your agent

After saving the config, restart the agent (or reload its MCP servers). The SkillForge tools will appear in the tool list.


Transport

The MCP server uses StdioServerTransport: it communicates over stdin/stdout, the standard for local MCP servers. There is no HTTP server, no port, and no authentication needed.


Available Tools

skillforge_validate

Validate a skill folder and return its format conformance score.

Input:

Parameter Type Required Description
path string Yes Absolute or relative path to the skill folder

Output:

{
  "skill": "forensics-agent",
  "score": 91,
  "diagnostics": [
    { "severity": "pass", "message": "YAML frontmatter valid", "check": "yaml-frontmatter" },
    { "severity": "pass", "message": "name field present", "check": "name-present" }
  ],
  "specVersion": "1.0",
  "passCount": 7,
  "warnCount": 0,
  "errorCount": 0
}

Example prompt to Claude Code:

"Validate the skill at ./forensics-agent and tell me if it's ready to install."


skillforge_install

Install a skill from a local directory or a git+https:// URL.

Input:

Parameter Type Required Default Description
source string Yes (none) Local path or git+https:// URL
scope "global" | "shared" | "project" No "project" Installation scope
force boolean No false Overwrite if already installed

Output:

{
  "installed": true,
  "skillName": "forensics-agent",
  "scope": "project",
  "score": 91,
  "diagnostics": []
}

Example prompt to Claude Code:

"Install the forensics-agent skill from git+https://github.com/acme/forensics-agent at project scope."


skillforge_uninstall

Remove an installed skill from a scope.

Input:

Parameter Type Required Default Description
skillName string Yes (none) Name of the skill to remove
scope "global" | "shared" | "project" No "project" Scope to remove from

Output:

{
  "removed": true,
  "skillName": "forensics-agent",
  "scope": "project"
}

skillforge_list

List installed skills across scopes.

Input:

Parameter Type Required Description
scope "global" | "shared" | "project" No Filter to a specific scope. Omit to show all.

Output:

[
  {
    "level": "global",
    "skills": []
  },
  {
    "level": "shared",
    "skills": []
  },
  {
    "level": "project",
    "skills": [
      {
        "name": "forensics-agent",
        "version": "1.0.0",
        "source": "community",
        "sourceUrl": "git+https://github.com/acme/forensics-agent",
        "installedAt": "2026-03-26T00:00:00.000Z",
        "specVersion": "1.0",
        "score": 91,
        "path": "skills/forensics-agent"
      }
    ]
  }
]

Example prompt to Claude Code:

"What skills do I have installed for this project?"


skillforge_suggest

Generate AI-powered skill suggestions based on project context.

Input:

Parameter Type Required Description
projectPath string No Path to project. Defaults to the server's working directory.

Output:

{
  "proposals": [
    {
      "skillName": "forensics-agent",
      "reason": "Your README mentions log analysis and debugging production incidents",
      "suggestedScope": "project",
      "available": true
    },
    {
      "skillName": "test-writer",
      "reason": "package.json has extensive test scripts",
      "suggestedScope": "project",
      "available": true
    }
  ]
}

Requirements: ANTHROPIC_API_KEY must be set in the server's environment (see setup above). Alternatively, point it at a custom Anthropic-compatible endpoint with ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN; see suggest.md.

Example prompt to Claude Code:

"Suggest skills I should install for this project based on the codebase."


skillforge_search

Search the SkillForge registry for skills.

Status: Stub; returns an empty result set. Full registry search is not yet implemented.

Input:

Parameter Type Required Description
query string Yes Search query

Output:

{
  "results": [],
  "total": 0,
  "message": "Registry search is not yet available in this version."
}

Available Resources

For MCP clients that support resource reading, the server exposes:

URI Content
skillforge://docs/skills-sh-api Mandatory reference for the skills.sh API — bundled snapshot of skills.sh/docs/api (Vercel OIDC authentication, endpoints, rate limits, response shapes). Read it before any request to skills.sh. Served with priority: 1 annotations (effectively required).
skill://index.json SEP-2640 discovery document: the most installed skills of the registry
skill://<name>/SKILL.md The SKILL.md of a registry skill
skill://<name>/<path> Any auxiliary file of a registry skill

Working Directory

The MCP server resolves the project scope relative to its working directory when it starts. When launched by Claude Code, this is typically the project root.

If you're using the server for a different project than where it started, pass an explicit projectPath to skillforge_suggest, or use absolute paths with skillforge_install.


Example Claude Code Session

User: What skills do I have installed?

Claude: [calls skillforge_list]
You have 1 skill installed at project scope:
- forensics-agent (score: 91/100, community)

User: Install the test-writer skill from my ~/skills directory.

Claude: [calls skillforge_install with source=~/skills/test-writer, scope=project]
Installed "test-writer" at project scope. Score: 84/100.

User: Suggest some more skills for this project.

Claude: [calls skillforge_suggest]
Based on your project context, I'd suggest:
1. code-reviewer: your package.json shows a TypeScript project with a review workflow
2. docs-generator: your README mentions documentation as a goal

Would you like me to install either of these?

Troubleshooting

"Could not connect to MCP server"

  • Verify the path in args is absolute and correct
  • Run node /path/to/SkillForge/dist/mcp/server.js directly and check for errors
  • Make sure npm run build was run after any changes

"ANTHROPIC_API_KEY is required"

  • The skillforge_suggest tool requires the API key in the server's environment
  • Add it to the env section of your .mcp.json

Tools not appearing in Claude Code

  • Restart Claude Code after modifying .mcp.json
  • Check that the JSON is valid (no trailing commas, etc.)
  • Check Claude Code's MCP server logs

Remote mode (claude.ai custom connector)

The same server also runs over Streamable HTTP for claude.ai:

cp .env.example .env   # set SKILLFORGE_ENV, SKILLFORGE_PORT, SKILLFORGE_PUBLIC_URL
skillforge serve       # or: docker compose up -d --build

Then on claude.ai: Settings > Connectors > Add custom connector with the URL https://<your-domain>/mcp (no authentication, unless SKILLFORGE_AUTH_TOKEN is set).

Remote mode exposes the catalog tools only (skillforge_start, skillforge_search, skillforge_skillset_search, skillforge_inspect, skillforge_activate, skillforge_file, skillforge_compare, skillforge_validate_remote); the filesystem install tools are stdio-only, because claude.ai has no access to your disk. On claude.ai, installation is virtual: skillforge_activate returns the complete SKILL.md and Claude follows it verbatim for the rest of the conversation. For a permanent install, Claude recreates the skill in the claude.ai skill panel and you click "Copy to your skills".