](https://npmjs.org/package/@yepcode/mcp-server) ](https://www.npmjs.com/package/@yepcode/mcp-server) ](https://github.com/yepcode/mcp-server-js/actions)
 ](https://smithery.ai/server/@yepcode/mcp-server)
什么是YepCode MCP服务器?
为什么选择YepCode MCP服务器?
- 无缝AI集成:将YepCode流程转换为零配置的AI就绪工具
- 实时过程控制:实现人工智能系统和工作流程之间的直接交互
- 企业级安全:在YepCode的隔离、生产就绪环境中执行代码
- 通用兼容性:与支持模型上下文协议的任何AI平台集成
YepCode:动态MCP工具服务器的完美环境
YepCode旨在成为运行 动态MCP工具服务器:
- 一个过程,一个工具:每个YepCode进程都可以作为MCP工具公开。标记您的流程(例如。
mcp-tool,core,automation)它们成为人工智能助手可以调用的工具。您可以通过以下方式确保访问安全 OAuth, API令牌,或您现有的YepCode凭据——每个工具都在您的工作区中以相同的安全模型运行。
- 完全控制刀具参数:每个工具都可以定义自己的 参数模式为JSON模式。您可以完全灵活地描述输入(类型、描述、必填字段、枚举、默认值等),因此AI可以接收丰富的元数据并正确调用您的工具。
- Polyglot工具实施:实施工具 python 或 Node.js (或两者)。同一个MCP服务器可以公开由不同运行时支持的工具——将其视为一个混合了多种语言实现的MCP服务器。
有关完整文档,请参阅 YepCode MCP服务器文档.
安装
提示: 通过您的YepCode帐户,您还可以访问不需要本地安装的托管MCP服务器。连接URL始终为: https://cloud.yepcode.io/mcp先决条件
获取您的YepCode API证书:
- 注册 YepCode云
- 访问
Settings>API credentials以创建新的API令牌。
使用NPX
确保你安装了Node.js(版本18或更高),并使用类似于以下的配置:
{
"mcpServers": {
"yepcode-mcp-server": {
"command": "npx",
"args": ["-y", "@yepcode/mcp-server"],
"env": {
"YEPCODE_API_TOKEN": "your_api_token_here"
}
}
}
}使用Docker
- 构建容器映像:
docker build -t yepcode/mcp-server .- 使用类似于以下内容的配置:
{
"mcpServers": {
"yepcode-mcp-server": {
"command": "docker",
"args": [
"run",
"-d",
"-e",
"YEPCODE_API_TOKEN=your_api_token_here",
"yepcode/mcp-server"
]
}
}
}调试
调试MCP服务器可能很棘手,因为它们通过stdio进行通信。为了使这更容易,我们建议使用 MCP检查员,您可以使用以下命令运行:
npm run inspector这将启动一个服务器,您可以在浏览器中直接访问调试工具。
YepCode MCP工具参考
MCP服务器提供了几个与YepCode基础设施交互的工具:
代码执行
run_code
在YepCode的安全环境中执行代码。
// Input
{
code: string; // The code to execute
options?: {
language?: string; // Programming language (default: 'javascript')
comment?: string; // Execution context
settings?: Record; // Runtime settings
}
}
// Response
{
returnValue?: unknown; // Execution result
logs?: string[]; // Console output
error?: string; // Error message if execution failed
}MCP选项
YepCode MCP服务器支持以下选项:
runCodeCleanup:跳过run_code清理。默认情况下,run_code进程源代码在执行后会被删除。如果您想保留它用于审计目的,可以使用此选项。skipCodingRules:跳过在run_code工具定义中包含编码规则。默认情况下,YepCode文档中的JavaScript和Python编码规则包含在工具模式中,以指导AI生成的代码。如果您想跳过此步骤以实现更快的工具初始化或更小的工具定义,可以使用此选项。
选项可以以逗号分隔的列表形式在 YEPCODE_MCP_OPTIONS 环境变量。
工具选择
您可以通过设置来控制启用哪些工具 YEPCODE_MCP_TOOLS 带有逗号分隔的工具类别和流程标签列表的环境变量:
内置工具类别:
run_code:启用代码执行工具yc_api:启用所有基本的API管理工具(流程、计划、变量、存储、执行、模块)yc_api_full:启用所有API管理工具,包括与版本相关的工具(扩展yc_api使用额外的流程和模块版本管理工具)- 任何特定的API工具名称(例如。,
execute_process_sync,get_execution,...)
流程标签:
- YepCode过程中使用的任何标签(例如。,
mcp-tool,core,automation等等) - 当您指定一个流程标签时,所有带有该标签的流程都将作为单独的MCP工具公开
- 工艺工具将使用工艺段(或前缀为
yc_如果名称超过60个字符,则显示进程ID)
如果未指定,默认情况下启用所有内置工具,但不会公开任何流程工具。
// NPX configuration with options
{
"mcpServers": {
"yepcode-mcp-server": {
"command": "npx",
"args": ["-y", "@yepcode/mcp-server"],
"env": {
"YEPCODE_API_TOKEN": "your_api_token_here",
"YEPCODE_MCP_OPTIONS": "runCodeCleanup,skipCodingRules",
"YEPCODE_MCP_TOOLS": "run_code,yc_api,mcp-tool,core"
}
}
}
}示例场景:
YEPCODE_MCP_TOOLS=run_code,yc_api-启用内置代码执行和基本API管理工具YEPCODE_MCP_TOOLS=run_code,yc_api_full-启用内置代码执行和所有API管理工具(包括版本管理)YEPCODE_MCP_TOOLS=core,automation-仅将标记为“核心”或“自动化”的流程作为工具公开YEPCODE_MCP_TOOLS=run_code,yc_api,core-启用内置工具以及标记为“核心”的所有流程
环境管理
设置_env_var
在YepCode工作区中设置环境变量。
// Input
{
key: string; // Variable name
value: string; // Variable value
isSensitive?: boolean; // Whether to mask the value in logs (default: true)
}remove_env_var
从YepCode工作区中删除环境变量。
// Input
{
key: string; // Name of the variable to remove
}存储管理
YepCode提供了一个内置的存储系统,允许您上传、列出、下载和删除文件。可以使用以下命令从代码执行中访问这些文件 yepcode.storage 辅助方法。
列表文件
列出YepCode存储中的所有文件。
// Input
{
prefix?: string; // Optional prefix to filter files
}
// Response
{
files: Array;
}上传文件
将文件上传到YepCode存储。
// Input
{
filename: string; // File path (e.g., 'file.txt' or 'folder/file.txt')
content: string | { // File content
data: string; // Base64 encoded content for binary files
encoding: "base64";
};
}
// Response
{
success: boolean; // Upload success status
filename: string; // Uploaded file path
}下载文件
从YepCode存储中下载文件。
// Input
{
filename: string; // File path to download
}
// Response
{
filename: string; // File path
content: string; // File content (base64 for binary files)
encoding?: string; // Encoding type if binary
}删除文件
从YepCode存储中删除文件。
// Input
{
filename: string; // File path to delete
}
// Response
{
success: boolean; // Deletion success status
filename: string; // Deleted file path
}流程执行
MCP服务器可以将您的YepCode进程作为单独的MCP工具公开,使AI助手可以直接访问它们。通过在 YEPCODE_MCP_TOOLS 环境变量。
它是如何工作的:
- 用任何标签标记您的YepCode进程(例如。,
core,api,automation,mcp-tool等等) - 将这些标签添加到
YEPCODE_MCP_TOOLS环境变量 - 所有带有指定标签的流程都将作为单独的MCP工具公开
每个暴露的过程都有一个工具,使用过程块命名(或前缀为 yc_ 如果工具名称超过60个字符,则显示进程ID)。
有关流程标签的更多信息,请参阅我们的 过程标签文档.
\
// Input
{
parameters?: any; // This should match the input parameters specified in the process
options?: {
tag?: string; // Process version to execute
comment?: string; // Execution context
};
synchronousExecution?: boolean; // Whether to wait for completion (default: true)
}
// Response (synchronous execution)
{
executionId: string; // Unique execution identifier
logs: string[]; // Process execution logs
returnValue?: unknown; // Process output
error?: string; // Error message if execution failed
}
// Response (asynchronous execution)
{
executionId: string; // Unique execution identifier
}API管理工具
API管理工具类别(yc_api 和 yc_api_full)提供全面的API访问,以管理YepCode工作空间的各个方面:
API基本工具(yc_api): 这 yc_api 标签为整个工作区的核心操作启用了标准的API管理工具。
扩展的API工具(yc_api_full): 这 yc_api_full 标签包括以下内容 yc_api 以及用于管理流程和模块版本的其他工具。
流程管理:
get_processes-列出具有可选筛选功能的进程create_process-使用源代码创建新流程get_process-获取流程详细信息update_process-更新现有流程delete_process-删除进程get_process_versions-获取流程版本(需要yc_api_full)execute_process_async-异步执行进程execute_process_sync-同步执行进程schedule_process-安排一个进程自动运行
进度管理:
get_schedules-列出计划流程get_schedule-获取日程安排详细信息pause_schedule-暂停计划进程resume_schedule-恢复暂停的计划delete_schedule-删除计划update_schedule-更新计划流程
变量管理:
get_variables-列出团队变量create_variable-创建新变量update_variable-更新现有变量delete_variable-删除变量
存储管理:
get_storage_objects-列出存储对象upload_storage_object-将文件上传到存储download_storage_object-从存储中下载文件delete_storage_object-从存储中删除文件
执行管理:
get_executions-使用可选筛选列出执行情况get_execution-从API获取执行详细信息kill_execution-终止正在运行的执行rerun_execution-重新运行之前的执行get_execution_logs-获取执行日志
模块管理:
get_modules-列出脚本库模块create_module-创建新模块get_module-获取模块详细信息delete_module-删除模块get_module_versions-获取模块版本(需要yc_api_full)get_module_version-获取特定模块版本(需要yc_api_full)delete_module_version-删除模块版本(需要yc_api_full)get_module_aliases-获取模块版本别名(需要yc_api_full)
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
