mcp-skill-server 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_skill_server-0.1.0/.claude/skills/hello_world/SKILL.md +19 -0
- mcp_skill_server-0.1.0/.claude/skills/hello_world/hello.py +29 -0
- mcp_skill_server-0.1.0/.github/workflows/ci.yml +54 -0
- mcp_skill_server-0.1.0/.github/workflows/publish.yml +27 -0
- mcp_skill_server-0.1.0/.gitignore +47 -0
- mcp_skill_server-0.1.0/.pre-commit-config.yaml +7 -0
- mcp_skill_server-0.1.0/.python-version +1 -0
- mcp_skill_server-0.1.0/CLAUDE.md +86 -0
- mcp_skill_server-0.1.0/LICENSE +21 -0
- mcp_skill_server-0.1.0/PKG-INFO +276 -0
- mcp_skill_server-0.1.0/README.md +251 -0
- mcp_skill_server-0.1.0/docs/HOW_TO_CREATE_SKILLS.md +149 -0
- mcp_skill_server-0.1.0/examples/hello_world/SKILL.md +19 -0
- mcp_skill_server-0.1.0/examples/hello_world/hello.py +29 -0
- mcp_skill_server-0.1.0/pyproject.toml +68 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/__init__.py +56 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/cli.py +435 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/executor.py +273 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/loader.py +437 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/models.py +55 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/plugins/__init__.py +21 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/plugins/base.py +78 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/plugins/formatters.py +49 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/plugins/gcs.py +176 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/plugins/local.py +35 -0
- mcp_skill_server-0.1.0/src/mcp_skill_server/server.py +325 -0
- mcp_skill_server-0.1.0/tests/__init__.py +0 -0
- mcp_skill_server-0.1.0/tests/test_cli.py +276 -0
- mcp_skill_server-0.1.0/tests/test_loader.py +454 -0
- mcp_skill_server-0.1.0/tests/test_security.py +445 -0
- mcp_skill_server-0.1.0/tests/test_server.py +214 -0
- mcp_skill_server-0.1.0/uv.lock +1207 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hello-world
|
|
3
|
+
description: A simple example skill that greets users. Use this to test your skill server setup.
|
|
4
|
+
entry: uv run python hello.py
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Hello World Skill
|
|
8
|
+
|
|
9
|
+
A minimal example skill demonstrating the skill format.
|
|
10
|
+
|
|
11
|
+
## Usage Examples
|
|
12
|
+
|
|
13
|
+
- "Run hello world"
|
|
14
|
+
- "Say hello to Alice"
|
|
15
|
+
- "Greet Bob with enthusiasm"
|
|
16
|
+
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
Prints a greeting message. Supports optional name and enthusiasm level.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Simple hello world skill for testing."""
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
parser = argparse.ArgumentParser(description="A friendly greeting skill")
|
|
9
|
+
parser.add_argument(
|
|
10
|
+
"--name",
|
|
11
|
+
type=str,
|
|
12
|
+
default="World",
|
|
13
|
+
help="Name to greet",
|
|
14
|
+
)
|
|
15
|
+
parser.add_argument(
|
|
16
|
+
"--enthusiasm",
|
|
17
|
+
type=int,
|
|
18
|
+
default=1,
|
|
19
|
+
help="Number of exclamation marks (1-5)",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
args = parser.parse_args()
|
|
23
|
+
|
|
24
|
+
exclaim = "!" * min(max(args.enthusiasm, 1), 5)
|
|
25
|
+
print(f"Hello, {args.name}{exclaim}")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main()
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: astral-sh/setup-uv@v5
|
|
16
|
+
with:
|
|
17
|
+
enable-cache: true
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
run: uv python install 3.12
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: uv sync --dev
|
|
24
|
+
|
|
25
|
+
- name: Ruff check
|
|
26
|
+
run: uv run ruff check .
|
|
27
|
+
|
|
28
|
+
- name: Ruff format check
|
|
29
|
+
run: uv run ruff format --check .
|
|
30
|
+
|
|
31
|
+
test:
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
strategy:
|
|
34
|
+
matrix:
|
|
35
|
+
python-version: ["3.12", "3.13"]
|
|
36
|
+
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
|
|
40
|
+
- uses: astral-sh/setup-uv@v5
|
|
41
|
+
with:
|
|
42
|
+
enable-cache: true
|
|
43
|
+
|
|
44
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
45
|
+
run: uv python install ${{ matrix.python-version }}
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: uv sync --dev
|
|
49
|
+
|
|
50
|
+
- name: Run tests
|
|
51
|
+
run: uv run pytest
|
|
52
|
+
|
|
53
|
+
- name: Check import
|
|
54
|
+
run: uv run python -c "import mcp_skill_server; print(mcp_skill_server.__version__)"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
run: uv python install 3.12
|
|
22
|
+
|
|
23
|
+
- name: Build package
|
|
24
|
+
run: uv build
|
|
25
|
+
|
|
26
|
+
- name: Publish to PyPI
|
|
27
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
.venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.idea/
|
|
31
|
+
.vscode/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
|
|
36
|
+
# Testing
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
.coverage
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
|
|
42
|
+
# Skill outputs
|
|
43
|
+
**/output/
|
|
44
|
+
|
|
45
|
+
# OS
|
|
46
|
+
.DS_Store
|
|
47
|
+
Thumbs.db
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
MCP Skill Server is a local MCP (Model Context Protocol) server for developing and testing skills before deploying them to production agents. It allows rapid iteration on skills locally instead of the deploy → test → iterate cycle.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install dependencies
|
|
13
|
+
uv sync --dev
|
|
14
|
+
|
|
15
|
+
# Run tests
|
|
16
|
+
uv run pytest
|
|
17
|
+
|
|
18
|
+
# Run server with example skills
|
|
19
|
+
uv run mcp-skill-server examples/
|
|
20
|
+
|
|
21
|
+
# Run server with custom skills directory
|
|
22
|
+
uv run mcp-skill-server /path/to/skills
|
|
23
|
+
|
|
24
|
+
# Initialize a new skill (standalone command)
|
|
25
|
+
uv run mcp-skill-init ./path/to/skill -n "skill-name" -d "Description"
|
|
26
|
+
|
|
27
|
+
# Or use as subcommand
|
|
28
|
+
uv run mcp-skill-server init ./path/to/skill
|
|
29
|
+
|
|
30
|
+
# Validate a skill (standalone command)
|
|
31
|
+
uv run mcp-skill-validate ./path/to/skill
|
|
32
|
+
|
|
33
|
+
# Or use as subcommand
|
|
34
|
+
uv run mcp-skill-server validate ./path/to/skill
|
|
35
|
+
|
|
36
|
+
# Install with GCS output handler support
|
|
37
|
+
uv sync --extra gcs
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Architecture
|
|
41
|
+
|
|
42
|
+
### Core Components
|
|
43
|
+
|
|
44
|
+
- **`server.py`**: MCP server entry point. Exposes four MCP tools: `list_skills`, `get_skill`, `run_skill`, `refresh_skills`. Uses stdio transport.
|
|
45
|
+
|
|
46
|
+
- **`loader.py`**: Skill discovery and schema inference. Scans for `*/SKILL.md` files, parses YAML frontmatter, and dynamically discovers commands/parameters by running `--help` on each skill's entry command.
|
|
47
|
+
|
|
48
|
+
- **`executor.py`**: Runs skill commands as subprocesses. Detects output files in `output/` directory or via `OUTPUT_FILE:` prefix in stdout.
|
|
49
|
+
|
|
50
|
+
- **`models.py`**: Pydantic request/response models.
|
|
51
|
+
|
|
52
|
+
### Plugin System
|
|
53
|
+
|
|
54
|
+
Two plugin types in `plugins/`:
|
|
55
|
+
|
|
56
|
+
**Output Handlers** - Process files generated by skills:
|
|
57
|
+
- `OutputHandler` (base class): Abstract interface for processing output files
|
|
58
|
+
- `LocalOutputHandler`: Default handler, just tracks local file paths
|
|
59
|
+
- `GCSOutputHandler`: Optional, uploads to Google Cloud Storage (requires `gcs` extra)
|
|
60
|
+
|
|
61
|
+
**Response Formatters** - Customize MCP tool response formatting:
|
|
62
|
+
- `ResponseFormatter` (base class): Abstract interface for formatting execution results
|
|
63
|
+
- `DefaultResponseFormatter`: Default text-based formatter
|
|
64
|
+
|
|
65
|
+
### Skill Format
|
|
66
|
+
|
|
67
|
+
Skills are folders containing a `SKILL.md` with YAML frontmatter:
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
---
|
|
71
|
+
name: my-skill
|
|
72
|
+
description: What it does
|
|
73
|
+
entry: uv run python script.py
|
|
74
|
+
---
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Commands and parameters are auto-discovered by parsing argparse `--help` output. Skills save outputs to `output/` directory.
|
|
78
|
+
|
|
79
|
+
### Key Data Flow
|
|
80
|
+
|
|
81
|
+
1. Server discovers skills via `SkillLoader.discover_skills()` → finds `*/SKILL.md` files
|
|
82
|
+
2. On `get_skill`, calls `skill.refresh_commands()` → runs `entry -h` to discover schema
|
|
83
|
+
3. On `run_skill`, `SkillExecutor.execute()` builds bash command and runs subprocess
|
|
84
|
+
4. Output files detected in `output/` or via `OUTPUT_FILE:` stdout marker
|
|
85
|
+
5. Optional `OutputHandler` processes output files (upload, copy, etc.)
|
|
86
|
+
6. `ResponseFormatter` formats execution result for MCP tool response
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Janine Cheng
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-skill-server
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Develop AI skills locally in your editor, deploy to production when ready
|
|
5
|
+
Project-URL: Homepage, https://github.com/jcc-ne/mcp-skill-server
|
|
6
|
+
Project-URL: Repository, https://github.com/jcc-ne/mcp-skill-server
|
|
7
|
+
Project-URL: Issues, https://github.com/jcc-ne/mcp-skill-server/issues
|
|
8
|
+
Author: Janine Cheng
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,llm,mcp,skills,testing
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Requires-Dist: mcp>=1.0.0
|
|
20
|
+
Requires-Dist: pydantic>=2.0.0
|
|
21
|
+
Requires-Dist: pyyaml>=6.0
|
|
22
|
+
Provides-Extra: gcs
|
|
23
|
+
Requires-Dist: google-cloud-storage>=2.0.0; extra == 'gcs'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
Most coding assistants now support skills natively, so an MCP server just for skill discovery isn't necessary. Where this package adds value is making skills' execution **deterministic and deployable** — with a fixed entry point and controlled execution, skills developed in your editor can run in non-sandboxed production environments. It also supports incremental loading, so agents discover skills on demand instead of loading everything upfront.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
# MCP Skill Server
|
|
30
|
+
|
|
31
|
+
[](https://github.com/jcc-ne/mcp-skill-server/actions/workflows/ci.yml)
|
|
32
|
+
[](https://pypi.org/project/mcp-skill-server/)
|
|
33
|
+
[](https://pypi.org/project/mcp-skill-server/)
|
|
34
|
+
[](LICENSE)
|
|
35
|
+
|
|
36
|
+
Build agent skills where you work. Write a Python script, add a `SKILL.md`, and your agent can use it immediately. Iterate in real-time as part of your daily workflow. When it's ready, deploy the same skill to production — no rewrite needed.
|
|
37
|
+
|
|
38
|
+
## Why?
|
|
39
|
+
|
|
40
|
+
Most skill development looks like this: write code → deploy → test in a staging agent → realize it's wrong → redeploy → repeat. It's slow, and you never get to actually *use* the skill while building it.
|
|
41
|
+
|
|
42
|
+
MCP Skill Server flips this. It runs **on your machine, inside your editor** — Claude Code, Cursor, or Claude Desktop. You develop a skill and use it in your real work at the same time. That tight feedback loop (edit → save → use) means you discover what's missing naturally, not through artificial test scenarios.
|
|
43
|
+
The premise is if the skill doesn't work well with Claude Code, it's unlikely to work with a less sophisticated agent.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### How skills mature to survive in the outside world
|
|
47
|
+
|
|
48
|
+
Claude skills can already have companion scripts, but there's no formalized entry point — the agent decides how to invoke them. That works for local use, but it's not deployable: a production MCP server can't reliably call a skill if the execution path isn't fixed.
|
|
49
|
+
|
|
50
|
+
MCP Skill Server enforces a declared **`entry` field** in your SKILL.md frontmatter (e.g. `entry: uv run python my_script.py`). This gives you a single, fixed entry point that the server controls. Commands and parameters are discovered from the script's `--help` output — that's the source of truth, not the LLM's interpretation of your code.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
1. Claude/coding agent skill → SKILL.md + scripts, but no fixed entry — agent decides how to run them
|
|
54
|
+
2. Local MCP skill (+ entry) → Fixed entry point, schema from --help, usable daily via this server
|
|
55
|
+
3. Production → Same skill, same entry — deployed to your enterprise MCP server
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Sharpen locally, then harden for production
|
|
59
|
+
|
|
60
|
+
Every agent that connects to the MCP server gets the same interface — `list_skills`, `get_skill`, `run_skill` — so the skill's description, parameter names, and help text are identical regardless of which agent calls them. That said, different agents have different strengths — a skill that works locally still needs testing with your production agent.
|
|
61
|
+
|
|
62
|
+
1. **Use it yourself** — build the skill, use it daily via Claude Code or Cursor. Fix descriptions and param names when the agent misuses the skill.
|
|
63
|
+
2. **Test with a weaker model** — try a smaller model to surface interface ambiguity.
|
|
64
|
+
3. **Add a deterministic entry point** — declare `entry` in SKILL.md for reliable, secure execution. Use `skill init` to scaffold it, `skill validate` to check readiness.
|
|
65
|
+
4. **Test with your production agent** — verify end-to-end in your target environment, then deploy.
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
### Claude Desktop (one-click)
|
|
70
|
+
|
|
71
|
+
[](claudedesktop://install?config=%7B%22mcpServers%22%3A%7B%22skills%22%3A%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-skill-server%22%2C%22serve%22%2C%22.%2Fmy-skills%22%5D%7D%7D%7D)
|
|
72
|
+
|
|
73
|
+
After installing, edit the skills path in your Claude Desktop config to point to your skills directory.
|
|
74
|
+
|
|
75
|
+
### Claude Code
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
claude mcp add skills -- uvx mcp-skill-server serve /path/to/my/skills
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Cursor
|
|
82
|
+
|
|
83
|
+
Add to `.cursor/mcp.json` in your project (or Settings → MCP → Add Server):
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"skills": {
|
|
89
|
+
"command": "uvx",
|
|
90
|
+
"args": ["mcp-skill-server", "serve", "/path/to/my/skills"]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Manual install
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# From PyPI (recommended)
|
|
100
|
+
uv pip install mcp-skill-server
|
|
101
|
+
|
|
102
|
+
# Or from source
|
|
103
|
+
git clone https://github.com/jcc-ne/mcp-skill-server
|
|
104
|
+
cd mcp-skill-server && uv sync
|
|
105
|
+
|
|
106
|
+
# Run the server
|
|
107
|
+
uvx mcp-skill-server serve /path/to/my/skills
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Then add to your editor's MCP config:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"skills": {
|
|
116
|
+
"command": "uvx",
|
|
117
|
+
"args": ["mcp-skill-server", "serve", "/path/to/my/skills"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Creating a Skill
|
|
124
|
+
|
|
125
|
+
### Option A: Use `skill init` (recommended)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Create a new skill
|
|
129
|
+
uv run mcp-skill-server init ./my_skills/hello -n "hello" -d "A friendly greeting"
|
|
130
|
+
|
|
131
|
+
# Or use the standalone command
|
|
132
|
+
uv run mcp-skill-init ./my_skills/hello -n "hello" -d "A friendly greeting"
|
|
133
|
+
|
|
134
|
+
# Promote an existing prompt-only Claude skill to a runnable MCP skill
|
|
135
|
+
uv run mcp-skill-init ./existing_claude_skill
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Option B: Manual setup
|
|
139
|
+
|
|
140
|
+
#### 1. Create a folder with your script
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
my_skills/
|
|
144
|
+
└── hello/
|
|
145
|
+
├── SKILL.md
|
|
146
|
+
└── hello.py
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### 2. Add SKILL.md with frontmatter
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
---
|
|
153
|
+
name: hello
|
|
154
|
+
description: A friendly greeting skill
|
|
155
|
+
entry: uv run python hello.py
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
# Hello Skill
|
|
159
|
+
|
|
160
|
+
Greets the user by name.
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
#### 3. Write your script with argparse
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
# hello.py
|
|
167
|
+
import argparse
|
|
168
|
+
|
|
169
|
+
parser = argparse.ArgumentParser(description="Greeting skill")
|
|
170
|
+
parser.add_argument("--name", default="World", help="Name to greet")
|
|
171
|
+
args = parser.parse_args()
|
|
172
|
+
|
|
173
|
+
print(f"Hello, {args.name}!")
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
That's it. The server auto-discovers commands and parameters from your `--help` output — no config needed.
|
|
177
|
+
|
|
178
|
+
## Validating for Deployment
|
|
179
|
+
|
|
180
|
+
When a skill is ready to graduate to production:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
uv run mcp-skill-server validate ./my_skills/hello
|
|
184
|
+
# or
|
|
185
|
+
uv run mcp-skill-validate ./my_skills/hello
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Checks:
|
|
189
|
+
- Required frontmatter fields (name, description, entry)
|
|
190
|
+
- Entry command uses allowed runtime
|
|
191
|
+
- Script file exists
|
|
192
|
+
- Commands discoverable via `--help`
|
|
193
|
+
|
|
194
|
+
## How It Works
|
|
195
|
+
|
|
196
|
+
### MCP Tools
|
|
197
|
+
|
|
198
|
+
The server exposes four tools to your agent:
|
|
199
|
+
|
|
200
|
+
| Tool | Description |
|
|
201
|
+
|------|-------------|
|
|
202
|
+
| `list_skills` | List all available skills |
|
|
203
|
+
| `get_skill` | Get details about a skill (commands, parameters) |
|
|
204
|
+
| `run_skill` | Execute a skill with parameters |
|
|
205
|
+
| `refresh_skills` | Reload skills after you make changes |
|
|
206
|
+
|
|
207
|
+
### Schema Discovery
|
|
208
|
+
|
|
209
|
+
The server automatically discovers your skill's interface by parsing `--help` output:
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
# Subcommands become separate commands
|
|
213
|
+
subparsers = parser.add_subparsers(dest='command')
|
|
214
|
+
analyze = subparsers.add_parser('analyze', help='Run analysis')
|
|
215
|
+
|
|
216
|
+
# Arguments become parameters with inferred types
|
|
217
|
+
analyze.add_argument('--year', type=int, required=True) # int, required
|
|
218
|
+
analyze.add_argument('--file', type=str) # string, optional
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Output Files
|
|
222
|
+
|
|
223
|
+
Files saved to `output/` are automatically detected. Alternatively, print `OUTPUT_FILE:/path/to/file` to stdout.
|
|
224
|
+
|
|
225
|
+
## Plugins
|
|
226
|
+
|
|
227
|
+
### Output Handlers
|
|
228
|
+
|
|
229
|
+
Process files generated by skills (upload, copy, transform, etc.):
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
from mcp_skill_server.plugins import OutputHandler, LocalOutputHandler
|
|
233
|
+
|
|
234
|
+
# Default: tracks local file paths
|
|
235
|
+
handler = LocalOutputHandler()
|
|
236
|
+
|
|
237
|
+
# Optional GCS handler (requires `uv sync --extra gcs`)
|
|
238
|
+
from mcp_skill_server.plugins import GCSOutputHandler
|
|
239
|
+
handler = GCSOutputHandler(
|
|
240
|
+
bucket_name="my-bucket",
|
|
241
|
+
folder_prefix="skills/outputs/",
|
|
242
|
+
)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Response Formatters
|
|
246
|
+
|
|
247
|
+
Customize how execution results are formatted in MCP tool responses:
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from mcp_skill_server.plugins import ResponseFormatter
|
|
251
|
+
|
|
252
|
+
class CustomFormatter(ResponseFormatter):
|
|
253
|
+
def format_execution_result(self, result, skill, command):
|
|
254
|
+
return f"Result: {result.stdout}"
|
|
255
|
+
|
|
256
|
+
# Use with create_server()
|
|
257
|
+
from mcp_skill_server import create_server
|
|
258
|
+
server = create_server(
|
|
259
|
+
"/path/to/skills",
|
|
260
|
+
response_formatter=CustomFormatter()
|
|
261
|
+
)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Development
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
git clone https://github.com/jcc-ne/mcp-skill-server
|
|
268
|
+
cd mcp-skill-server
|
|
269
|
+
uv sync --dev
|
|
270
|
+
uv run pytest
|
|
271
|
+
uv run mcp-skill-server serve examples/
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
MIT
|