Infer MCP Server
This MCP server provides secure remote execution and database query capabilities for AI copilot tools through policy-controlled SSH and PostgreSQL connections.
Core capabilities:
Execute SSH commands - Run commands on remote servers through configured profiles with command allowlists, output quotas, execution timeouts, and concurrency limits
Query PostgreSQL databases - Execute SQL queries with statement pattern restrictions, row limits, and execution time constraints
Train machine learning classifiers - Orchestrate classifier training jobs remotely using SSH profiles with customizable command templates and subclass iteration
Enforce security policies - All operations governed by command regex patterns, execution limits, and production mode enforcement
Manage credentials securely - Store secrets via environment variables, filesystem paths, or inline JSON with support for base64-encoded keys
Control concurrency - Limit simultaneous operations per profile with cancellation-aware execution and progress notifications
Test and debug - Built-in simulator and integration test suite for testing without external AI client tools
Integrate with AI Copilots - Connect to GitHub Copilot in VS Code, Cursor, or other MCP-compatible AI tools
Enables execution of database queries against PostgreSQL databases through RDBMS connections
Click on "Deploy 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., "@Infer MCP Server run python train.py on training-cluster with dataset /data/images"
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.
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 installBuild:
npm run buildRun:
npm start
Related MCP server: MCP SSH Session
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. The sample config includes alocal-testprofile against127.0.0.1with placeholder credentials (tester/changeme) so you can quickly exercise SSH tooling via a local daemon—update these values before real use.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. For quick localhost smoke-tests, aim INFER_MCP_CONFIG_PATH at config/sample-config.json, ensure your SSH server accepts the local-test credentials, or tweak that profile to match an existing local account. The server runs in permissive local-test mode by default; set INFER_MCP_MODE=production to re-enable SSH policy enforcement for the loopback profile when you deploy.
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.
Available Tools
3 toolsdbQueryB
Execute a SQL query on a PostgreSQL database using a configured profile
Inputs: profile (required), query (required), parameters, timeoutMs, +1 more. Returns: rows, rowCount, truncated, durationMs
sshExecuteB
Execute a command on a remote server via SSH using a configured profile
Inputs: profile (required), command (required), cwd, env, +2 more. Returns: signal, stderr, stdout, exitCode, +2 more
trainClassifierB
Run classifier training commands on a remote host via SSH
Inputs: profile (required), subclasses (required), datasetPath (required), commandTemplate, +2 more. Returns: job
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: dbQuery handles SQL queries on PostgreSQL, sshExecute runs general commands via SSH, and trainClassifier specifically trains classifiers via SSH. There is no overlap in functionality, making tool selection unambiguous for an agent.
The naming is mixed: dbQuery and sshExecute follow a verb_noun pattern, but trainClassifier uses a verb_noun format without underscore separation. While readable, this inconsistency in convention (snake_case vs. camelCase) reduces predictability across the set.
With only 3 tools, the server feels thin for a general-purpose 'Infer MCP Server' that spans database queries, SSH execution, and machine learning tasks. This limited set may not adequately cover the implied scope, leaving gaps in related operations.
The tool surface is severely incomplete for the inferred domain of data and remote operations. There are no tools for database management (e.g., create/update tables), SSH file operations, or classifier evaluation/deployment, creating significant gaps that will hinder agent workflows.
Related MCP Connectors
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables seamless SSH operations including secure connections, file transfers, interactive shell sessions, and Docker container management on remote servers. Supports both password and SSH key authentication with credential management and connection pooling.18MIT
- AlicenseAqualityDmaintenanceEnables AI agents to establish and manage persistent SSH connections to remote hosts for executing commands. Supports SSH config files, multi-host management, and automatic reconnection with thread-safe concurrent operations.1551 PyPI11MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isolation to prevent unauthorized operations.1023 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to execute SSH commands on network devices using natural language, supporting multiple vendors and authentication methods for automated network management.GPL 3.0