Infer MCP Server

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.

Category
Visit Server

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

  1. Install dependencies: npm install
  2. Build: npm run build
  3. 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
	}
}
  • sshProfiles define reusable credentials for tools such as sshExecute and trainClassifier. For password, privateKey, or passphrase, 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-profile maxConcurrent slots.
  • databaseProfiles centralise PostgreSQL access. Statements must match the configured regex allowlists and respect row/time limits, with maxConcurrent restricting simultaneous queries per profile.
  • training controls 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 (default node)
  • MCP_SERVER_ARGS – comma-separated arguments (default build/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_PATH or INFER_MCP_CONFIG (the staging sample references environment variables and secret files under config/secrets/).
  • Run npm run test:integration to execute Vitest suites that shell out to the simulator (guarded by INTEGRATION=1).
  • The integration suite expects the simulator to list sshExecute, dbQuery, and trainClassifier; extend tests/integration/ with additional cases as you add tools.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured