Infer MCP Server
Enables remote command execution via SSH and database queries through PostgreSQL connections. Supports classifier training orchestration with configurable SSH profiles for AI-assisted infrastructure management.
README
Infer MCP Server
This is an MCP (Model Context Protocol) server providing resource access via SSH and RDBMS connections. It is designed to integrate with AI Copilot tools like GitHub Copilot in VS Code and Cursor.
Setup
- Install dependencies:
npm install - Build:
npm run build - Run:
npm start
Features
- SSH command execution enforced through configured profiles, command allowlists, and output quotas
- PostgreSQL database queries limited to configured connections and statement patterns
- Per-profile concurrency limits with cancellation-aware execution and progress notifications
- Classifier training orchestration via SSH profiles
Configuration
The server loads configuration from either INFER_MCP_CONFIG_PATH (JSON file) or INFER_MCP_CONFIG (inline JSON string). A starter config is available at config/sample-config.json; copy .env.example to .env and update paths/secrets as needed.
Secrets can be provided inline, via environment variables, or read from disk. Example:
{
"sshProfiles": {
"training-cluster": {
"host": "cluster.example.com",
"username": "trainer",
"privateKey": {
"path": "./secrets/training-cluster.key"
},
"policy": {
"allowedCommands": ["^python\\s+train.py\\b"],
"maxExecutionMs": 900000,
"maxOutputBytes": 1048576
}
}
},
"databaseProfiles": {
"training-metadata": {
"connectionString": { "env": "TRAINING_METADATA_DB_URL" },
"allowedStatements": ["^\\s*SELECT\\b", "^\\s*WITH\\b"],
"maxRows": 1000,
"maxExecutionMs": 20000
}
},
"training": {
"defaultCommandTemplate": "python train.py --dataset={{datasetPath}} --class={{subclass}}",
"defaultTimeoutMs": 600000
}
}
sshProfilesdefine reusable credentials for tools such assshExecuteandtrainClassifier. Forpassword,privateKey, orpassphrase, supply either a raw string,{ "env": "VAR_NAME" }, or{ "path": "relative/or/absolute" }. Base64-encoded files are supported with{ "path": "...", "encoding": "base64" }. Policies control command allowlists, maximum runtime, captured output size, and per-profilemaxConcurrentslots.databaseProfilescentralise PostgreSQL access. Statements must match the configured regex allowlists and respect row/time limits, withmaxConcurrentrestricting simultaneous queries per profile.trainingcontrols defaults for classifier jobs.
Integration
Configure in your AI tool's MCP settings to connect to this server.
For VS Code GitHub Copilot: Add to mcp.json in .vscode folder.
Debugging
You can debug this MCP server using VS Code's debugger.
Simulator
Build the project (npm run build) and use the simulator to exercise tools locally without an agent client:
npm run simulate -- list
npm run simulate -- call sshExecute '{"profile":"training-cluster","command":"python train.py --help"}'
npm run simulate -- call dbQuery '{"profile":"training-metadata","query":"SELECT * FROM jobs LIMIT 5"}'
Override defaults with environment variables:
MCP_SERVER_COMMAND– binary to launch (defaultnode)MCP_SERVER_ARGS– comma-separated arguments (defaultbuild/index.js)MCP_SERVER_CWD– working directory for the spawned server
For staging validation, copy config/staging-config.json, populate the referenced secrets, and set INFER_MCP_CONFIG_PATH=$(pwd)/config/staging-config.json before running npm run simulate -- … commands.
Integration Testing
- Build the project (
npm run build) so the simulator artifact exists. - Configure staging credentials via
INFER_MCP_CONFIG_PATHorINFER_MCP_CONFIG(the staging sample references environment variables and secret files underconfig/secrets/). - Run
npm run test:integrationto execute Vitest suites that shell out to the simulator (guarded byINTEGRATION=1). - The integration suite expects the simulator to list
sshExecute,dbQuery, andtrainClassifier; extendtests/integration/with additional cases as you add tools.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。