๐ Skill Management MCP Server
A Model Context Protocol (MCP) server enabling Claude to manage skills stored in ~/.skill-mcp/skills, allowing for programmatic creation, editing, running, and management of skills, including script execution with environment variables.
๐ Quick Start
1. Install uv
This project uses uv for fast, reliable Python package management.
curl -LsSf https://astral.sh/uv/install.sh | sh
2. Configure Your MCP Client
Add the MCP server to your configuration. The server will be automatically downloaded and run via uvx from PyPI.
Claude Desktop - Edit the config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
Cursor - Edit the config file:
- macOS:
~/.cursor/mcp.json
- Windows:
%USERPROFILE%\.cursor\mcp.json
- Linux:
~/.cursor/mcp.json
{
"mcpServers": {
"skill-mcp": {
"command": "uvx",
"args": [
"--from",
"skill-mcp",
"skill-mcp-server"
]
}
}
}
That's it! No installation needed - uvx will automatically download and run the latest version from PyPI.
3. Restart Your MCP Client
Restart Claude Desktop or Cursor to load the MCP server.
4. Test It
In a new conversation:
List all available skills
Claude should use the skill-mcp tools to show skills in ~/.skill-mcp/skills/.
โจ Features
Skill Management
- โ
List all available skills
- โ
Browse skill files and directory structure
- โ
Read skill files (SKILL.md, scripts, references, assets)
- โ
Create new skill files and directories
- โ
Update existing skill files
- โ
Delete skill files
Script Execution
- โ
Run Python, Bash, and other executable scripts
- โ
Automatic dependency management for Python scripts using uv inline metadata (PEP 723)
- โ
Automatic environment variable injection from secrets
- โ
Command-line argument support
- โ
Custom working directory support
- โ
Capture stdout and stderr
- โ
30 - second timeout for safety
Direct Python Execution - Multi - Skill Unification ๐
- โ
UNIFY MULTIPLE SKILLS in one execution - Combine utilities from different skills seamlessly
- โ
Execute Python code directly without creating script files
- โ
Cross - skill imports - Import modules from ANY skill as reusable libraries
- โ
Automatic dependency aggregation - Dependencies from ALL imported skills auto - merged
- โ
Environment variable loading - .env files from ALL referenced skills auto - loaded
- โ
PEP 723 support - Inline dependency declarations in code
- โ
98.7% more efficient - Follows Anthropic's recommended MCP pattern for scalable agents
- โ
Perfect for multi - skill workflows, quick experiments, data analysis, and complex pipelines
Environment Variables
- โ
List environment variable keys (secure - no values shown)
- โ
Set or update environment variables per skill
- โ
Persistent storage in per - skill
.env files
- โ
Automatic injection into script execution
๐ฆ Installation
Installation from PyPI
To install the package globally (optional):
pip install skill-mcp
Or use uvx to run without installation (recommended):
uvx --from skill-mcp skill-mcp-server
๐ป Usage Examples
Creating a New Skill
User: "Create a new skill called 'pdf-processor' that can rotate and merge PDFs"
Claude will:
1. Create the skill directory and SKILL.md
2. Add any necessary scripts
3. Test the scripts
4. Guide you through setting up any needed dependencies
Managing Environment Variables
User: "I need to set up a GitHub API token for my GitHub skills"
Claude will:
1. Guide you to add it to the skill's .env file
2. Use `read_skill_env` to list available keys
3. Confirm it's available for scripts to use via `os.environ`
Running Skill Scripts
User: "Run the data processing script from my analytics skill"
Claude will:
1. List available skills and scripts
2. Execute the script with environment variables
3. Show you the output and any errors
Modifying Existing Skills
User: "Add a new reference document about our API schema to the company - knowledge skill"
Claude will:
1. Read the existing skill structure
2. Create the new reference file
3. Update SKILL.md if needed to reference it
๐ป Basic Usage
import requests
response = requests.get("https://api.example.com/data")
print(response.json())
๐ป Cross - Skill Imports - Unifying Multiple Skills
The power of composition - Create utility skills once and combine them in endless ways:
Real - world example: Process sales data by unifying calculator, data - processor, and CRM skills:
Step 1: Create a calculator skill with reusable modules
def add(a, b):
return a + b
def multiply(a, b):
return a * b
Step 2: Create data - processor skill utilities
import pandas as pd
def parse_csv_url(url):
return pd.read_csv(url)
def filter_by_status(df, status):
return df[df['status'] == status]
Step 3: Unify both skills in one execution!
from math_utils import calculate_average
from csv_parser import parse_csv_url, filter_by_status
sales_df = parse_csv_url('https://example.com/sales.csv')
active_deals = filter_by_status(sales_df, 'active')
deal_values = active_deals['amount'].tolist()
avg_deal = calculate_average(deal_values)
print(f"Active deals: {len(active_deals)}")
print(f"Average deal size: ${avg_deal:,.2f}")
๐ Documentation
Quick Status
| Property |
Details |
| Status |
โ
Production Ready |
| Test Coverage |
86% (145/145 tests passing) |
| Deployed |
October 18, 2025 |
| Architecture |
22 - module modular Python package with unified CRUD architecture |
Overview
TL;DR: Write Python code that unifies multiple skills in one execution - follows [Anthropic's MCP pattern](https://www.anthropic.com/engineering/code - execution - with - mcp) for 98.7% more efficient agents.
This project consists of two main components:
- MCP Server (
src/skill_mcp/server.py) - A Python package providing 5 unified CRUD tools for skill management
- Skills Directory (
~/.skill-mcp/skills/) - Where you store and manage your skills
Key Advantages
๐ Unified Multi - Skill Execution (Code Execution with MCP)
Build once, compose everywhere - Execute Python code that seamlessly combines multiple skills in a single run:
from math_utils import calculate_average
from json_fetcher import fetch_json
from weather_api import get_forecast
weather = fetch_json('https://api.weather.com/cities')
temps = [city['temp'] for city in weather['cities']]
avg_temp = calculate_average(temps)
forecast = get_forecast('London')
print(f"Average temperature: {avg_temp}ยฐF")
print(f"London forecast: {forecast}")
What makes this powerful:
- โ
Context - efficient - Dependencies and env vars auto - aggregated from all referenced skills
- โ
Composable - Mix and match utilities from any skill like building blocks
- โ
No redundancy - Declare PEP 723 dependencies once in library skills, reuse everywhere
- โ
Progressive disclosure - Load only the skills you need, when you need them
- โ
Follows Anthropic's MCP pattern - [Code execution with MCP](https://www.anthropic.com/engineering/code - execution - with - mcp) for efficient agents
Efficiency gains:
- ๐ 98.7% fewer tokens when discovering tools progressively vs loading all upfront
- ๐ Intermediate results stay in code - Process large datasets without bloating context
- โก Single execution - Complex multi - step workflows in one code block instead of chained tool calls
This aligns with Anthropic's research showing agents scale better by writing code to call tools rather than making direct tool calls for each operation.
๐ Not Locked to Claude UI
Unlike the Claude interface, this system uses the Model Context Protocol (MCP), which is:
- โ
Universal - Works with Claude Desktop, claude.ai, Cursor, and any MCP - compatible client
- โ
Not tied to Claude - Same skills work everywhere MCP is supported
- โ
Future - proof - Not dependent on Claude's ecosystem or policy changes
- โ
Local - first - Full control over your skills and data
๐ฏ Use Skills Everywhere
Your skills can run in:
- Cursor - IDE integration with MCP support
- Claude Desktop - Native app with MCP access
- claude.ai - Web interface with MCP support
- Any MCP client - Growing ecosystem of compatible applications
๐ฆ Independent & Modular
- โ
Each skill is self - contained with its own files, scripts, and environment
- โ
No dependency on proprietary Claude features
- โ
Can be versioned, shared, and reused across projects
- โ
Standard MCP protocol ensures compatibility
๐ Share Skills Across All MCP Clients
- โ
One skill directory, multiple clients - Create once, use everywhere
- โ
Same skills in Cursor and Claude - No duplication needed
- โ
Seamless switching - Move between tools without reconfiguring
- โ
Consistent experience - Skills work identically across all MCP clients
- โ
Centralized management - Update skills in one place, available everywhere
๐ค LLM - Managed Skills (No Manual Copy - Paste)
Instead of manually copying, zipping, and uploading files:
โ OLD WAY: Manual process
1. Create skill files locally
2. Zip the skill folder
3. Upload to Claude interface
4. Wait for processing
5. Can't easily modify or version
โ
NEW WAY: LLM - managed programmatically
1. Tell Claude: "Create a new skill called 'data - processor'"
2. Claude creates the skill directory and SKILL.md
3. Tell Claude: "Add a Python script to process CSVs"
4. Claude creates and tests the script
5. Tell Claude: "Set the API key for this skill"
6. Claude updates the .env file
7. Tell Claude: "Run the script with this data"
8. Claude executes it and shows results - all instantly!
Key Benefits:
- โ
No manual file operations - LLM handles creation, editing, deletion
- โ
Instant changes - No upload/download/reload cycles
- โ
Full version control - Skills are regular files, can use git
- โ
Easy modification - LLM can edit scripts on the fly
- โ
Testable - LLM can create and run scripts immediately
- โ
Collaborative - Teams can develop skills together via MCP
Available MCP Tools
The server provides these unified CRUD tools to Claude:
| Tool |
Purpose |
PEP 723 Support |
skill_crud |
Unified skill operations: list, get, create, delete, validate, list_templates |
N/A |
skill_files_crud |
Unified file operations: read, create, update, delete (supports bulk operations) |
N/A |
skill_env_crud |
Unified environment variable operations: read, set, delete, clear |
N/A |
run_skill_script |
Execute scripts (.py, .js, .sh) with automatic dependency detection |
โ
YES - Auto - detects PEP 723 in Python scripts |
execute_python_code |
Execute Python code directly without files (cross - skill imports) |
โ
YES - PEP 723 PLUS dependency aggregation |
| Key Benefits of CRUD Architecture: |
|
|
- โ
Reduced context window usage - 5 tools instead of 9+
- โ
Consistent operation patterns - All tools follow the same CRUD model
- โ
Bulk operations - Create/update/delete multiple files atomically
- โ
Better error handling - Unified error responses across all operations
Troubleshooting
"MCP server not found"
- Check that
uv is in your PATH: which uv (or where uv on Windows)
- Verify the path to
.skill-mcp directory is correct and absolute
- Test dependencies:
cd ~/.skill-mcp && uv run python -c "import mcp; print('OK')"
- Ensure
pyproject.toml exists in ~/.skill-mcp/
"Permission denied" errors
chmod +x ~/.skill-mcp/skill_mcp_server.py
chmod 755 ~/.skill-mcp
chmod 755 ~/.skill-mcp/skills
find ~/.skill-mcp/skills -name ".env" -exec chmod 600 {} \;
Scripts failing to execute
- Check script has execute permissions
- Verify interpreter (python3, bash) is in PATH
- Use
list_env_keys to check required variables are set
- Check stderr output from
run_skill_script
Environment variables not working
- Verify they're set: use
read_skill_env for the skill
- Check the .env file exists:
cat ~/.skill-mcp/skills/<skill-name>/.env
- Ensure your script is reading from
os.environ
Advanced: CRUD Tool Operations
All MCP tools follow a unified CRUD architecture with detailed descriptions:
skill_crud Operations
- list - List all skills with descriptions, paths, and validation status (supports text/regex search)
- get - Get comprehensive skill information: SKILL.md content, all files, scripts, environment variables
- create - Create new skill from template (basic, python, bash, nodejs)
- delete - Delete a skill directory (requires confirmation)
- validate - Validate skill structure and get diagnostics
- list_templates - List all available skill templates with descriptions
skill_files_crud Operations
- read - Read one or multiple files in a skill directory (supports bulk reads)
- create - Create one or more files (auto - creates parent directories, supports atomic bulk creation)
- update - Update one or more existing files (supports bulk updates)
- delete - Delete a file permanently (path - traversal protected, SKILL.md cannot be deleted)
skill_env_crud Operations
- read - List environment variable keys for a skill (values hidden for security)
- set - Set one or more environment variables (merges with existing)
- delete - Delete one or more environment variables
- clear - Clear all environment variables for a skill
Script Execution
- run_skill_script - Execute scripts with automatic PEP 723 dependency detection and environment variable injection
- execute_python_code - Execute Python code directly without files (supports PEP 723 dependencies and cross - skill imports)
Advanced Configuration
Custom Skills Directory
The skills directory can be customized using the SKILL_MCP_DIR environment variable. If not set, it defaults to ~/.skill-mcp/skills.
Setting via environment variable (recommended):
export SKILL_MCP_DIR="/custom/path/to/skills"
echo 'export SKILL_MCP_DIR="/custom/path/to/skills"' >> ~/.zshrc
In MCP client configuration:
For Claude Desktop or Cursor, add the environment variable to your MCP config:
{
"mcpServers": {
"skill-mcp": {
"command": "uvx",
"args": [
"--from",
"skill-mcp",
"skill-mcp-server"
],
"env": {
"SKILL_MCP_DIR": "/custom/path/to/skills"
}
}
}
}
Notes:
- The directory will be created automatically if it doesn't exist
- Use absolute paths for the custom directory
- All skills will be stored in the configured directory
- No global secrets file; env vars are per - skill .env files
Resource Limits
Resource limits are defined in src/skill_mcp/core/config.py:
MAX_FILE_SIZE = 1_000_000
MAX_OUTPUT_SIZE = 100_000
SCRIPT_TIMEOUT_SECONDS = 30
To modify these limits, you'll need to fork the repository and adjust the constants in the config file.
Architecture & Implementation
Package Structure
src/skill_mcp/
โโโ server.py # MCP server entry point
โโโ models.py # Pydantic input/output models (backward compat)
โโโ models_crud.py # Unified CRUD input models
โโโ core/
โ โโโ config.py # Configuration constants
โ โโโ exceptions.py # Custom exception types
โโโ services/
โ โโโ env_service.py # Environment variable CRUD
โ โโโ file_service.py # File CRUD operations
โ โโโ skill_service.py # Skill discovery & metadata
โ โโโ script_service.py # Script execution & PEP 723
โ โโโ template_service.py # Template management
โโโ utils/
โ โโโ path_utils.py # Secure path validation
โ โโโ yaml_parser.py # YAML frontmatter parsing
โ โโโ script_detector.py # Script capability detection
โโโ tools/
โโโ skill_crud.py # Unified skill CRUD tool
โโโ skill_files_crud.py # Unified file CRUD tool
โโโ skill_env_crud.py # Unified env CRUD tool
โโโ script_tools.py # Script execution tools
tests/
โโโ conftest.py # Pytest fixtures
โโโ 20+ test modules # 145 tests (86% coverage passing)
What's New
Unified CRUD Architecture:
- โ
3 unified CRUD tools instead of 9+ individual tools (skill_crud, skill_files_crud, skill_env_crud)
- โ
Bulk operations - Create/update/delete multiple files atomically
- โ
Consistent patterns - All tools follow the same operation - based model
- โ
Better error handling - Unified error responses across all operations
Direct Python Execution (Multi - Skill Unification):
- ๐ execute_python_code - UNIFY MULTIPLE SKILLS in one execution (Anthropic's recommended MCP pattern)
- โ
Cross - skill imports - Import modules from ANY skill as reusable libraries
- โ
Automatic dependency aggregation - Dependencies from ALL imported skills auto - merged
- โ
Automatic environment loading - .env files from ALL referenced skills auto - loaded
- โ
PEP 723 support - Inline dependency declarations
- ๐ 98.7% token reduction - Load skills progressively instead of all upfront
Enhanced Features:
- โ
Skill templates - Create skills from templates (basic, python, bash, nodejs)
- โ
Template discovery - List all available templates with descriptions
- โ
Skill validation - Validate skill structure and get diagnostics
- โ
Search capabilities - Search skills by name/description with text or regex
- โ
Namespaced paths - File paths shown as "skill_name:file.py" for clarity
- โ
Configurable skills directory - Use SKILL_MCP_DIR environment variable
Test Results
Unit Tests: 145/145 Passing โ
Coverage: 86% (959/1120 statements covered)
Comprehensive test coverage across all modules:
| Module |
Coverage |
Key Areas |
| Core Config |
100% |
All configuration constants |
| Models & CRUD Models |
100% |
Input/Output validation |
| Exception Handling |
100% |
All exception types |
| YAML Parser |
90% |
Frontmatter parsing |
| Skill Service |
90% |
Skill discovery & metadata |
| Template Service |
96% |
Template management |
| File Service |
83% |
File CRUD operations |
| Environment Service |
85% |
Environment variable CRUD |
| Skill CRUD Tool |
91% |
Unified skill operations |
| Skill Files CRUD Tool |
88% |
Unified file operations |
| Skill Env CRUD Tool |
96% |
Unified env operations |
| Script Detector |
85% |
Script capability detection |
| Path Utils |
86% |
Path validation & security |
| Server |
76% |
MCP tool registration |
| Script Service |
78% |
Script execution & PEP 723 |
| Script Tools |
29% |
Script execution tools |
| Test Organization: |
|
|
- โ
CRUD operations: Comprehensive tests for all operations (create, read, update, delete)
- โ
Bulk operations: Atomic transaction tests for file operations
- โ
Template system: Template discovery, validation, and creation
- โ
Path security: Directory traversal prevention and validation
- โ
PEP 723 support: Dependency detection and aggregation
- โ
Integration tests: Full MCP server workflow testing
Manual Tests: All Passed โ
- โ
List skills with YAML descriptions and search functionality
- โ
Get comprehensive skill details with SKILL.md content
- โ
Create skills from templates (basic, python, bash, nodejs)
- โ
Read/create/update/delete files (single and bulk)
- โ
Read/set/delete/clear environment variables
- โ
Execute scripts with auto - dependencies (PEP 723)
- โ
Execute Python code directly with cross - skill imports
- โ
Dependency aggregation from imported skill modules
- โ
Environment variable loading from referenced skills
Verification Checklist
- โ
Server imports successfully
- โ
All 5 unified CRUD tools registered and callable
- โ
145/145 unit tests passing (86% coverage)
- โ
All manual tests passing
- โ
MCP client configuration working (Claude Desktop, Cursor)
- โ
Package deployed to PyPI and active
- โ
Scripts execute successfully with PEP 723 dependencies
- โ
File operations working (including bulk operations)
- โ
Environment variables working (CRUD operations)
- โ
Template system working (create, list, validate)
- โ
Direct Python execution working with cross - skill imports
- โ
Backward compatible with existing skills
Best Practices
Skill Development
- Follow the standard skill structure (SKILL.md, scripts/, references/, assets/)
- Keep SKILL.md concise and focused
- Use progressive disclosure (split large docs into references)
- Test scripts immediately after creation
Environment Variables
- Use descriptive names (API_KEY, DATABASE_URL)
- Never log or print sensitive values
- Set permissions on .env files:
chmod 600 ~/.skill-mcp/skills/<skill-name>/.env
Script Development
- Use meaningful exit codes (0 = success)
- Print helpful messages to stdout
- Print errors to stderr
- Include error handling
- For Python scripts with dependencies: Use inline metadata (PEP 723)
- Scripts without metadata use the system Python interpreter
- Scripts with metadata automatically get isolated environments via uv
๐ Managing Sensitive Secrets Safely
To prevent LLMs from accessing your sensitive credentials:
โ
RECOMMENDED: Update .env files directly on the file system
nano ~/.skill-mcp/skills/my-skill/.env
API_KEY=your-actual-api-key-here
DATABASE_PASSWORD=your-password-here
OAUTH_TOKEN=your-token-here
chmod 600 ~/.skill-mcp/skills/my-skill/.env
Why this is important:
- โ
LLMs never see your sensitive values
- โ
Secrets stay on your system only
- โ
No risk of credentials appearing in logs or outputs
- โ
Full control over sensitive data
- โ
Can be used with
git-secret or similar tools for versioning
Workflow:
- Claude creates the skill structure and scripts
- You manually add sensitive values to
.env files
- Claude can read the
.env keys (without seeing values) and use them
- Scripts access secrets via environment variables at runtime
Example:
$ nano ~/.skill-mcp/skills/api-client/.env
API_KEY=sk-abc123def456xyz789
ENDPOINT=https://api.example.com
$ chmod 600 ~/.skill-mcp/skills/api-client/.env
โ NEVER DO:
- โ Tell Claude your actual API keys or passwords
- โ Ask Claude to set environment variables with sensitive values
- โ Store secrets in SKILL.md or other tracked files
- โ Use
update_skill_env tool with real secrets (only for non - sensitive config)
โ
DO:
- โ
Update
.env files manually on your system
- โ
Keep
.env files in .gitignore
- โ
Use
chmod 600 to restrict file access
- โ
Tell Claude only the variable names (e.g., "the API key is in API_KEY")
- โ
Keep secrets completely separate from LLM interactions
โ ๏ธ Important: Verify LLM - Generated Code
When Claude or other LLMs create or modify skills and scripts using this MCP system, always verify the generated code before running it in production:
Security Considerations
- โ ๏ธ Always review generated code - LLMs can make mistakes or generate suboptimal code
- โ ๏ธ Check for security issues - Look for hardcoded credentials, unsafe operations, or vulnerabilities
- โ ๏ธ Test thoroughly - Run scripts in isolated environments first
- โ ๏ธ Validate permissions - Ensure scripts have appropriate file and system permissions
- โ ๏ธ Monitor dependencies - Review any external packages installed via PEP 723
Best Practices for LLM - Generated Skills
- Review before execution - Always read through generated scripts
- Test in isolation - Run in a safe environment before production use
- Use version control - Track all changes with git for audit trails
- Implement error handling - Add robust error handling and logging
- Set resource limits - Use timeouts and resource constraints
- Run with minimal permissions - Don't run skills as root or with elevated privileges
- Validate inputs - Sanitize any user - provided data
- Audit logs - Review what scripts actually do and track their execution
Common Things to Check
- โ Hardcoded API keys, passwords, or tokens
- โ Unsafe file operations or path traversal risks
- โ Unvalidated external commands or shell injection risks
- โ Missing error handling or edge cases
- โ Resource - intensive operations without limits
- โ Unsafe deserialization (eval, pickle, etc.)
- โ Excessive permissions requested
- โ Untrustworthy external dependencies
When in Doubt
- Ask Claude/LLM to explain the code
- Have another person review critical code
- Use linters and security scanning tools
- Run in containers or VMs for isolation
- Start with read - only operations before destructive ones
Remember: LLM - generated code is a starting point. Your verification and review are essential for security and reliability.
๐ง Technical Details
Security Features
Path Validation
- All file paths are validated to prevent directory traversal attacks
- Paths with ".." or starting with "/" are rejected
- All operations are confined to the skill directory
Environment Variables
- Variable values are never exposed when listing
- Stored in per - skill
.env files
- File permissions should be restricted (chmod 600 on each .env)
Script Execution
- 30 - second timeout prevents infinite loops
- Scripts run with user's permissions (not elevated)
- Output size limits prevent memory issues
- Capture both stdout and stderr for debugging
๐ License
MIT License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Contributing
This is a custom tool for personal use. Feel free to fork and adapt for your needs.
Support
For setup issues or questions, refer to:
- Claude's MCP documentation at https://modelcontextprotocol.io
- The MCP Python SDK docs at https://github.com/modelcontextprotocol/python-sdk