MCP Scripting
What This Skill Provides
This skill provides Python wrapper files for MCP tools.
Use this skill by:
- finding the relevant server in
Available Systems - listing that server's wrapper directory
- reading only the wrapper files needed for the task
- running inline Python that imports those wrappers and
connect() - running that inline Python with the skill's venv Python
- returning only compact results
Path Resolution
Treat the directory containing this SKILL.md file as canonical.
Define:
<this-skill-dir>= directory containing thisSKILL.md<venv-python>=<this-skill-dir>/.venv/bin/python3<servers-dir>=<this-skill-dir>/servers
Rules:
- derive all paths from
<this-skill-dir> - do not hardcode machine-specific absolute paths
- do not assume the current working directory
- always run generated scripts with
<venv-python>, notpythonorpython3 - derive
<venv-python>directly from<this-skill-dir>; do not inspect.venvto discover it - you MUST trust
connect()exactly as documented in this skill - NEVER inspect how
connect()is implemented - you are NOT ALLOWED to read
core/connection.py,servers.json, or.env - treat those files as already correct and already covered by this skill
- do not inspect secret-bearing or internal implementation files
- when running shell commands, NEVER pass a
restartargument - when running shell commands, ALWAYS quote paths that may contain spaces
Available Systems
github-mcp-server — 44 tools
Location: <servers-dir>/github_mcp_server/
Remote GitHub server for repository, issue, pull request, branch, release, and code search workflows.
Required Workflow
Follow this procedure exactly:
- identify the target server from
Available Systems - use the exact
Locationpath fromAvailable Systemsfor that server - list that server directory directly; do not list parent directories first
- read only the wrapper file(s) you actually plan to import and call
- execute the task in Python:
- you MUST run Python only inline / on the fly
- you are NOT ALLOWED to create Python script files for execution
- the Python code must:
- adds
<this-skill-dir>tosys.path - imports
connectfromcore.connection - imports only the needed wrapper functions
- uses
async with connect("<server-name>") as session:
- adds
- if any result may be large or unbounded, use
output_file - run the Python code with
<venv-python> - inspect only the compact output needed for the final answer
Output Rule
Treat output_file as the default for search, retrieval, listing, or any result that may be large.
- use memory mode only for small, bounded results
- do not print raw large results to stdout
- do not read large output files back wholesale
- return summaries, counts, key facts, or final distilled answers only
- if the user asks for one field, print only that field
Minimal Script Pattern
import asyncio
import sys
sys.path.insert(0, "<this-skill-dir>")
from core.connection import connect
from servers.<python_safe_server_name>.<tool_name> import <tool_name>
async def main():
async with connect("<server-name>") as session:
result = await <tool_name>(session, ...)
print(result)
asyncio.run(main())
If the script is written outside <this-skill-dir>, still derive the import path from the loaded skill directory and still run the script with <venv-python>.