- Home
- MCP servers
- Remidiation
Remidiation
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You deploy and run an MCP Server to orchestrate AI-driven remediation test scenarios. It reads declarative YAML scenarios, injects faults, interacts with remediation APIs, evaluates AI responses, executes remediation commands, and produces test reports in a production-ready, type-safe Python environment.
How to use
You use a client to run predefined remediation scenarios against the MCP Server. A scenario defines fault injection, RCA evaluation, remediation commands, validation checks, and final reporting. You start the server, load a scenario, and then monitor the run results and artifacts stored per run.
How to install
# Prerequisites
python3.11+
pip install --upgrade pip
# Install dependencies
pip install -r requirements.txt
# Start the MCP server (in production you would use a supervisor or container runtime)
python -m mcp_server.server
Configuration and usage notes
Configure the MCP Server to connect to its HTTP Remediation API and local gRPC/WebSocket interfaces. You can provide settings via a YAML file or environment variables. The examples below show common keys you will use to tailor the server to your environment.
# config.yaml
log_dir: "./log"
session_timeout_sec: 300
ws:
ping_interval: 300
ping_timeout: 300
grpc:
host: "localhost"
port: 50051
timeout: 300
http:
base_url: "http://localhost:8901"
ws_url: "ws://localhost:8765/chatsocket"
token_url: "https://app.lab0.signalfx.com/v2/jwt/token"
Environment variables can override these values, for example:
export CONFIG_PATH=./config.yaml
export MCP_LOG_DIR=./log
export MCP_GRPC__HOST=localhost
export MCP_GRPC__PORT=50051
export MCP_HTTP__BASE_URL=http://localhost:8901
Run and monitor
Start the server in one terminal, then run a scenario from your client code or CLI tool. Results and artifacts are stored under the log directory, organized by run. You will typically view the live logs and then inspect the final report to understand the outcome of each stage.
python -m mcp_server.server
Example scenario execution flow
A scenario defines how faults are injected, how RCA is requested and evaluated, how remediation commands are executed in a sandbox, and how results are verified. The server follows a 13-state FSM to ensure reliable orchestration from initialization to cleanup.
Check results
After a run completes, inspect the run folder to review inputs, RCA/remediation transcripts, and the final report.
ls -la log/runs/
cat log/runs/run-*/report.json
Security and isolation
Commands are executed in a sandbox with deny patterns to prevent destructive actions. You can configure policies to control what remediation commands are allowed.
Troubleshooting tips
If the server fails to start, check that Python 3.11+ is available and that required environment variables are set. Review log/mcp_server.log for errors and verify that the HTTP remediation URL is reachable.
Additional notes
The MCP Server includes end-to-end orchestration for testing AI-powered remediation workflows, with integrations for HTTP/WebSocket clients, fault injection, and comprehensive logging. It uses a type-safe Python implementation with Pydantic validation to ensure correct data models across components.
Example command to start server (summary)
python -m mcp_server.server
Example programmatic run (summary)
import asyncio
from mcp_server.server import MCPServer
from mcp_server.config import get_settings
async def main():
settings = get_settings()
server = MCPServer(settings)
result = await server.scenario_service.run_scenario(
scenario_yaml=open("scenarios/example_scenario.yaml").read(),
bindings={"namespace": "staging"}
)
print(f"Run ID: {result['run_id']}")
print(f"Status: {result['status']}")
asyncio.run(main())
What you get with this MCP Server
The server offers declarative YAML-based scenarios, fault injection hooks, AI evaluation of RCA and remedies, sandboxed command execution, and comprehensive logs and artifacts to enable reproducible remediation testing.
Common workflow sections
Scenario metadata defines identifiers and ownership, defaults set timing and model, bindings provide runtime context, fault describes what gets injected, stabilize waits for system readiness, RCA and remedy prompts drive evaluation and actions, verify checks system state, cleanup ensures resources are freed, and report formats determine the output.
Supported tools and endpoints
The MCP Server exposes a set of services for orchestration, fault injection, execution, evaluation, and remediation client interactions. Each service coordinates its responsibilities to deliver end-to-end test results and artifacts.
Notes on deployment
For production, containerization and orchestration are recommended to manage process lifecycle, resource limits, and scaling. Use a process supervisor to ensure the MCP Server restarts on failure and to rotate logs.
Available tools
ScenarioService
gRPC service to run and manage remediation scenarios
FaultService
Service to inject and clean up faults in the target system
ExecutorService
Sandboxed command execution with output capture and artifact storage
EvalService
Evaluate AI responses using regex, JSON schema, and semantic similarity
RemediationClient
HTTP client for remediation workflow API interactions