Python_Scripts_MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Python_Scripts_MCPGenerate a directory tree of my project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AgentTools — Python 脚本工具集 (MCP Server)
通过 MCP (Model Context Protocol) 将本地 Python 工具脚本暴露给 AI 客户端(如 Claude Desktop)调用的工具集。
📦 功能概述
工具 | 功能 | 适用场景 |
tree_to_txt | 扫描目录生成文件树,保存为文本文件 | 项目结构概览、文档编写 |
xlsx_to_txt | 读取所有 | 将表格数据提供给 AI 处理 |
python_to_txt | 提取所有 | 代码审查、AI 上下文准备 |
text_to_txt | 自动检测编码,合并所有文本文件 | 文档汇总、语料整理 |
所有工具在扫描目录时自动跳过 .venv、__pycache__、.git 等目录,并尊重 .gitignore 配置。
Related MCP server: Skillz
🚀 快速开始
1. 安装依赖
本项目使用 uv 管理依赖:
uv sync2. 配置 MCP 客户端
将以下 JSON 添加到你的 MCP 客户端配置中(如 Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"python-script-runner": {
"command": "path\\to\\.venv\\Scripts\\python.exe",
"args": [
"path\\to\\mcp_server.py"
]
}
}
}⚠️ 请将
path\\to\\替换为你的实际项目路径。
3. 运行测试
python mcp_server.py🛠️ 工具详情
tree_to_txt
python tree_to_txt.py # 扫描当前目录
python tree_to_txt.py -d /path/to/project # 指定目录
python tree_to_txt.py -o tree.txt # 自定义输出文件名xlsx_to_txt
python xlsx_to_txt.py # 读取当前目录所有 xlsx
python xlsx_to_txt.py --raw-formulas # 提取公式原文
python xlsx_to_txt.py --max-rows 100 # 限制行数python_to_txt
python python_to_txt.py # 提取所有 .py 文件text_to_txt
python text_to_txt.py # 合并所有文本文件📄 LICENSE
本项目基于 MIT License 开源。
Available Tools
5 toolsmainA
简单的 Hello World 测试脚本。输出欢迎信息,用于验证 Python 环境是否正常工作。无需参数。
| Name | Required | Description | Default |
|---|---|---|---|
| args | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full transparency burden. It states the tool outputs a welcome message, which is a behavior, but it does not disclose whether there are any side effects, the nature of the output (e.g., stdout only), or how the optional 'args' parameter affects behavior. The phrase '无需参数' (no parameters needed) could also mislead about the existence of the args field in the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: two short sentences totaling about 40 characters. Every sentence contributes either to purpose or usage context, with no redundancies.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (a Hello World test, no output schema, one optional parameter), the description is mostly adequate. However, it fails to document the optional 'args' parameter's purpose and does not specify the exact format of the output, though these are minor gaps for such a trivial tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, so the description must compensate. It adds the useful directive that no parameters are needed, which clarifies that the 'args' parameter is optional and can be omitted. However, it does not explain what the 'args' parameter does if provided, leaving a semantic gap for an optional parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as a Hello World test script that outputs a welcome message, distinguishing it from the converter siblings (xlsx_to_txt, python_to_txt, etc.). It has a specific verb ('outputs') and resource ('welcome message').
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: 'used to verify Python environment works properly.' This implies when to use the tool, but it does not explicitly mention when not to use it or reference alternatives, so it misses the full 'when/when-not' guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
python_to_txtA
扫描当前目录下所有 .py 文件(递归),提取每个文件的代码内容,合并输出到一个文本文件中。格式:每个文件以【相对路径】和【代码】标记分隔。适用于:代码审查、准备 AI 上下文输入、代码汇总存档。无参数,默认扫描当前目录,输出到 output_py_files.txt。自动跳过 .venv、pycache、.git 目录及 .gitignore 中忽略的内容。
| Name | Required | Description | Default |
|---|---|---|---|
| args | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses key behaviors: recursive scanning, skipping .venv/__pycache__/.git, respecting .gitignore, output file name, and format markers. However, it claims 'no parameters' while the schema includes an optional 'args' parameter, a slight inconsistency that reduces transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Compact and well-structured: the description front-loads the core action, then format, use cases, and exclusions. Every sentence adds value, with no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description is comprehensive. It covers input scope, processing behavior, output format, excluded directories, and applicable use cases, making it sufficient for an agent to understand and invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description says no parameters are needed and defaults to the current directory, which clarifies usage, but it doesn't explain the existing 'args' field. With 0% schema coverage, the description could better compensate by addressing what the parameter might do or why it exists.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: scanning .py files recursively, extracting code, and merging into a text file. It distinguishes from sibling tools like xlsx_to_txt by explicitly targeting Python files and providing output format details.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Lists specific use cases (code review, AI context input, archive) but doesn't explicitly exclude alternatives or mention when not to use this tool. It provides clear context for when to use it, though it lacks a comparison to sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
text_to_txtA
扫描当前目录下所有文本文件(自动检测 UTF-8/UTF-16/GBK/Latin-1 编码),将文件内容合并输出到一个文本文件中。格式:每个文件以【文件名】标记分隔。适用于:文档汇总、语料准备、文本分析、合并散落的文本资料。无参数,默认扫描当前目录,跳过自身输出文件,输出到 merged_texts.txt。自动跳过 .venv 目录及 .gitignore 中忽略的内容。
| Name | Required | Description | Default |
|---|---|---|---|
| args | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so thoroughly: it discloses encoding auto-detection, skipping of its own output file, skipping .venv and .gitignore entries, and the output filename merged_texts.txt.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is dense but well-organized: it leads with the core behavior, then format, use cases, and edge cases. Every sentence adds distinct information with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameterless file-processing tool with no annotations and no output schema, the description is complete: it covers input scope, encoding handling, output file and format, and which directories/files are skipped. Nothing essential is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one optional undocumented `args` parameter and 0% coverage, so the description compensates by explicitly stating '无参数' and describing default behavior. It clarifies the tool needs no user-provided parameters, though it does not explain what the optional `args` field does if supplied.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: scans all text files in the current directory and merges them into one text file. It also clearly differentiates from sibling tools by targeting generic text files rather than specific formats like xlsx or python source.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides clear use contexts: '适用于:文档汇总、语料准备、文本分析、合并散落的文本资料'. It does not explicitly name exclusions or alternatives, but the scope and sibling names make appropriate usage clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tree_to_txtA
扫描指定目录(默认为当前目录)生成完整目录文件树,保存到文本文件中。适用于:项目结构概览、文档编写、了解目录层级关系。参数: -d <目录路径> 指定扫描目录(默认当前目录);-o <文件名> 指定输出文件(默认 file_tree.txt)。自动跳过 .venv、pycache、.git 目录及 .gitignore 中忽略的内容。
| Name | Required | Description | Default |
|---|---|---|---|
| args | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals key behaviors: automatic skipping of .venv, __pycache__, .git directories and content ignored by .gitignore. It also specifies defaults for the directory and output filename. This is valuable context beyond what the schema provides. It doesn't mention overwrite behavior or console output, but the core behaviors are well-covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured: a main sentence about the function, a list of use cases, parameter explanations, and exclusion behaviors. Every sentence adds value, and the primary purpose is front-loaded. No unnecessary fluff or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, the description is remarkably complete. It covers purpose, parameters and defaults, behavior (skipping directories), and use cases. The tool is simple (a single string argument), and the description fully equips an agent to invoke it correctly. The only minor omission is lack of explicit mention of what the output file content looks like beyond 'complete directory file tree', but this is implied.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has only one 'args' string parameter with no description (0% coverage). The description compensates by explaining the two command-line style parameters (-d for directory, -o for output file) and their defaults. It does not explicitly state that these flags should be passed as a single string in the 'args' field, but the implication is clear from the description. This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: scanning a specified directory (default current) to generate a complete directory file tree and save it to a text file. It uses a specific verb ('scans', 'generates', 'saves') and resource (directory tree), effectively distinguishing it from sibling tools like xlsx_to_txt and text_to_txt which deal with file conversions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly lists use cases: '适用于:项目结构概览、文档编写、了解目录层级关系' (suitable for project structure overview, documentation writing, understanding directory hierarchy). It provides clear context for when to use the tool, though it does not mention alternatives or explicitly state when not to use it. Given the distinct purpose, this is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
xlsx_to_txtA
扫描指定目录下所有 .xlsx Excel 文件,生成文件树并提取每个文件的所有 Sheet 内容,以表格格式输出到文本文件。自动过滤全空行/列。适用于:将 Excel 数据转换为 AI 可读的纯文本格式、批量提取表格数据。参数: -d <目录路径> 指定扫描目录(默认当前目录);-o <文件名> 指定输出文件(默认 xlsx_contents.txt);--raw-formulas 提取公式原文(默认提取计算后的值);--max-rows <行数> 限制每个 Sheet 最大读取行数。自动跳过 .venv 目录及 .gitignore 中忽略的内容。
| Name | Required | Description | Default |
|---|---|---|---|
| args | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description discloses key behaviors: automatically filters empty rows/columns, skips .venv and .gitignore, supports raw formula extraction, and has a max rows limit. It does not explicitly state whether it overwrites an existing output file or that source files remain unmodified, but the non-destructive nature is implied by the extraction-to-text purpose.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the main purpose and then provides features, use cases, and parameters in a logical order. While slightly verbose (e.g., the '适用于' section somewhat repeats the purpose), every sentence adds valuable information, and the structure is easy to follow.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the generic schema and no annotations or output schema, the description provides thorough coverage of functionality, parameters, defaults, and filtering behavior. It lacks explicit details about recursion into subdirectories (only says 'all .xlsx in the directory') and whether the output file is overwritten, but these are minor gaps for a conversion tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema is a single generic 'args' string with no parameter descriptions, so the description carries the full burden. It explains each CLI flag (-d, -o, --raw-formulas, --max-rows) with defaults and meanings, fully compensating for the schema's lack of detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool scans all .xlsx files in a directory, extracts all Sheet contents, and outputs them to a text file in table format. It also mentions generating a file tree and filtering empty rows/columns, making it distinct from siblings like tree_to_txt or text_to_txt.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states it is suitable for converting Excel data to AI-readable plain text and batch extracting table data. It does not explicitly name alternatives or exclusions, but the specific file type (.xlsx) and output format make the intended use case clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a distinct source format (Excel, Python, general text, directory tree), and main is clearly a test script. However, python_to_txt and text_to_txt both process .py files, which could cause minor confusion about which to use for a given task.
Four of the five tools follow a consistent <source>_to_txt naming pattern. The exception is main, which breaks the convention but is understandable as a simple test script.
With five tools, the server is well-scoped for its purpose. Each tool serves a clear utility function, and there are no redundant or unnecessary entries.
The server covers conversion of common source types to text, including Excel, Python, and general text files, plus directory tree export. Minor gaps include lack of support for other document formats (PDF, Word) and no option to process individual files rather than directories.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides a complete end-to-end MCP server implementation with file system tools, web scraping capabilities, and system information access. Includes ready-to-use configuration files and integration examples for Claude Desktop, ChatGPT, and other AI models.6
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that transforms Claude-style skills and resources into callable tools for any MCP-compatible agent or client. It automatically discovers, exposes, and executes scripts from skills organized in local directories or packaged archives.
- AlicenseNot gradedqualityBmaintenanceA dead simple MCP server for exposing your app functions to AI agents like Claude Desktop.215MIT
- FlicenseNot gradedqualityDmaintenanceA simple MCP server that provides basic utility tools for text manipulation, file operations, and calculations, intended to be connected to Claude AI desktop app.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Liangbiaoyong/Python_Scripts_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server