The Skill Management MCP Server enables programmatic management, execution, and composition of reusable skills stored locally, with automatic dependency management and environment variable handling.
Core Capabilities:
Skill Discovery & Management: List all available skills, retrieve comprehensive details (files, scripts, environment variables, documentation), and validate skill structure with SKILL.md metadata
File Operations (CRUD): Read, create, update, and delete files within skill directories with automatic parent directory creation
Script Execution: Run Python, Bash, and other executable scripts with automatic PEP 723 dependency installation via
uv, environment variable injection, custom arguments, and captured stdout/stderrDirect Python Execution: Execute raw Python code without files, supporting cross-skill imports with automatic dependency and environment variable aggregation from all referenced skills
Environment Variable Management: Securely list variable keys (values hidden), create or replace
.envfiles for per-skill credential storageMulti-Skill Composition: Unify utilities from multiple skills in single executions with automatic dependency merging and environment loading, achieving 98.7% token efficiency following Anthropic's MCP pattern
Security Features: Path validation, script timeouts, secure credential handling, and directory traversal protection
Cross-Platform Compatibility: Works with any MCP-compatible client including Claude Desktop, Cursor, and claude.ai
Use Cases: LLM-managed skill development, reusable utility libraries, API integrations with credential management, data processing pipelines, and composable multi-tool workflows.
Provides tools for managing per-skill environment variables stored in .env files, including setting and reading configuration values for skill execution
Enables programmatic management of skill files and directories, including creating, reading, updating, and deleting files within the skills directory structure
Supports version control integration for skills management, allowing skills to be tracked and versioned using git repositories
Supports GitHub integration through environment variable management for GitHub API tokens and related GitHub workflow automation
Provides tools for managing SKILL.md files and other Markdown documentation within the skills directory structure
Integrates with PyPI for automatic package distribution and installation via uvx, allowing the MCP server to be run directly from PyPI packages
Allows execution of Python scripts with automatic dependency management using PEP 723 inline metadata, enabling scripts to declare and automatically install their own dependencies
Enables execution of shell/bash scripts and other executable scripts with environment variable injection and output capture
Enables parsing and management of YAML frontmatter in skill files for metadata extraction and skill descriptions
Skill Management MCP Server
A Model Context Protocol (MCP) server that enables Claude to manage skills stored in ~/.skill-mcp/skills. This system allows Claude to create, edit, run, and manage skills programmatically, including execution of skill scripts with environment variables.
Quick Status
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 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 managementSkills 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:
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 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:
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
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
.envfilesā Automatic injection into script execution
Directory Structure
Note: The MCP server is installed via uvx from PyPI and runs automatically. No local server file needed!
Quick Start
1. Install uv
This project uses uv for fast, reliable Python package management.
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.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Cursor - Edit the config file:
macOS:
~/.cursor/mcp.jsonWindows:
%USERPROFILE%\.cursor\mcp.jsonLinux:
~/.cursor/mcp.json
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:
Claude should use the skill-mcp tools to show skills in ~/.skill-mcp/skills/.
Common uv Commands
For development in this repository:
Note: uv automatically creates and manages .venv/ - no need to manually create virtual environments!
Script Dependencies (PEP 723)
ā BOTH
Python scripts and code can declare their own dependencies using uv's inline metadata. The server automatically detects this and uses uv run to handle dependencies:
Benefits:
ā No manual dependency installation needed
ā Each script/code execution has isolated dependencies
ā Works automatically with both
run_skill_scriptandexecute_python_codeā Version pinning ensures reproducibility
ā
execute_python_codeALSO aggregates dependencies from skill imports!
How it works with
You add inline metadata to your Python script file
When the script runs via
run_skill_script, the server detects the metadatauv automatically creates an isolated environment and installs dependencies
The script runs with access to those dependencies
No manual
pip installor virtual environment management needed!
How it works with
Include PEP 723 metadata directly in your code string
The server automatically detects the metadata
uv creates an isolated environment and installs dependencies
Your code runs with access to those dependencies
BONUS: If you import from skill files, their PEP 723 dependencies are automatically aggregated too!
Example: See example-skill/scripts/fetch_data.py for a working example.
Testing locally:
Direct Python Code Execution - Unify Multiple Skills in One Run
The execute_python_code tool allows you to run Python code that combines multiple skills in a single execution. This is perfect for:
š Multi-skill workflows - Import and compose utilities from different skills
š§Ŗ Quick experiments - Test code without creating files
š Data analysis - Process data using libraries from multiple skills
šļø Building on reusable skill libraries - Create specialized utilities once, use everywhere
Key insight from Anthropic's research: Agents scale better by writing code to call tools instead of making direct tool calls. This approach reduces context usage by up to 98.7% and enables more efficient workflows.
Basic Usage
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
Step 2: Create data-processor skill utilities
Step 3: Unify both skills in one execution!
What just happened:
ā Two skills unified - calculator + data-processor in one execution
ā Zero redundancy - pandas dependency declared once in csv_parser.py, auto-included
ā Composable - Mix and match any skills like LEGO blocks
ā Context-efficient - Only loaded the specific modules needed
Automatic Dependency Aggregation
When you import from skill modules that have PEP 723 dependencies, they're automatically included:
Library skill with dependencies:
Your code - NO need to redeclare requests!
Environment Variables from Referenced Skills
When you import from a skill, its environment variables are automatically loaded:
Skill with API credentials:
Your code - env vars automatically available:
Benefits:
ā No need to manually load .env files
ā Each skill's secrets stay isolated
ā Multiple skills' env vars are merged automatically
ā Later skills override earlier ones if there are conflicts
Use Cases
š Multi-skill workflows - THE KILLER FEATURE - Unify utilities from multiple skills in one execution
Example: Combine API client + data parser + analytics calculator in single run
Example: Chain together scraper + NLP processor + notification sender
Example: Merge CRM data + payment processor + reporting tools
ā Quick data analysis - Run pandas/numpy code without creating files
ā API testing - Test HTTP requests with inline dependencies
ā Reusable libraries - Build once, import everywhere
ā Rapid prototyping - Experiment with code before committing to files
ā Complex pipelines - Build multi-stage data processing in one code block
Comparison: run_skill_script vs execute_python_code
Both tools support PEP 723, but have different use cases:
Feature |
|
|
PEP 723 Support | ā YES | ā YES |
Requires file | ā Yes - executes existing script files | ā No - runs code directly |
Languages supported | Python, JavaScript, Bash, any executable | Python only |
Cross-skill imports | ā No - single skill only | ā YES - UNIFY MULTIPLE SKILLS |
Dependency aggregation | ā No | ā YES - auto-merges deps from all imported skills |
Environment loading | Loads skill's .env only | Loads .env from ALL referenced skills |
Context efficiency | Standard | 98.7% token reduction (Anthropic research) |
Best for | Running complete scripts, batch jobs | Multi-skill workflows , quick experiments |
Example use case |
|
|
Key Insight:
Use
run_skill_scriptwhen you have a script file ready to executeUse
execute_python_codewhen you want to UNIFY MULTIPLE SKILLS in one execution - This is the recommended approach per Anthropic's MCP research for building efficient, scalable agents
Usage Examples
Creating a New Skill
Managing Environment Variables
Running Skill Scripts
Modifying Existing Skills
Available MCP Tools
The server provides these unified CRUD tools to Claude:
Tool | Purpose | PEP 723 Support |
| Unified skill operations: list, get, create, delete, validate, list_templates | N/A |
| Unified file operations: read, create, update, delete (supports bulk operations) | N/A |
| Unified environment variable operations: read, set, delete, clear | N/A |
| Execute scripts (.py, .js, .sh) with automatic dependency detection | ā YES - Auto-detects PEP 723 in Python scripts |
| 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
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
.envfilesFile 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
Troubleshooting
"MCP server not found"
Check that
uvis in your PATH:which uv(orwhere uvon Windows)Verify the path to
.skill-mcpdirectory is correct and absoluteTest dependencies:
cd ~/.skill-mcp && uv run python -c "import mcp; print('OK')"Ensure
pyproject.tomlexists in~/.skill-mcp/
"Permission denied" errors
Scripts failing to execute
Check script has execute permissions
Verify interpreter (python3, bash) is in PATH
Use
list_env_keysto check required variables are setCheck stderr output from
run_skill_script
Environment variables not working
Verify they're set: use
read_skill_envfor the skillCheck the .env file exists:
cat ~/.skill-mcp/skills/<skill-name>/.envEnsure 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):
In MCP client configuration:
For Claude Desktop or Cursor, add the environment variable to your MCP config:
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:
To modify these limits, you'll need to fork the repository and adjust the constants in the config file.
Architecture & Implementation
Package Structure
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)
# /// script # dependencies = [ # "package-name>=version", # ] # ///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
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-secretor similar tools for versioning
Workflow:
Claude creates the skill structure and scripts
You manually add sensitive values to
.envfilesClaude can read the
.envkeys (without seeing values) and use themScripts access secrets via environment variables at runtime
Example:
ā 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_envtool with real secrets (only for non-sensitive config)
ā DO:
ā Update
.envfiles manually on your systemā Keep
.envfiles in.gitignoreā Use
chmod 600to 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.
Installation from PyPI
To install the package globally (optional):
Or use uvx to run without installation (recommended):
Development Setup
If you want to contribute or run from source:
To use your local development version in your MCP client config:
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