Sponsored by Deepsite.site

Development Environment MCP Server

Created By
0nilinkz6 months ago
Multi-platform environment detection MCP server for VS Code Copilot integration
Content

Development Environment MCP Server

A Model Context Protocol (MCP) server that provides intelligent environment detection and command syntax assistance for cross-platform development workflows.

Features

  • Automatic Environment Detection: Detects Windows, Linux, macOS, and Raspberry Pi environments
  • Shell-Aware Command Syntax: Provides correct terminal command syntax for PowerShell, Bash, Zsh
  • VS Code Integration: Seamless integration with GitHub Copilot and VS Code tasks
  • Cross-Platform: Works across Windows, Linux, and macOS development environments
  • Extensible: Easy to extend with new tools and environment detection logic

Quick Start

Installation

# Install from PyPI (when published)
pip install dev-environment-mcp

# Or install from source
git clone https://github.com/yourusername/dev-environment-mcp.git
cd dev-environment-mcp
pip install -e .

Standalone Usage

# Run as standalone script
dev-env-mcp --help

# Get environment summary
dev-env-mcp detect-environment --format summary

# Get command syntax for specific operation
dev-env-mcp get-command-syntax --operation test --format shell

MCP Server Mode

# Run as MCP server (stdio transport)
dev-env-mcp --mcp-mode

# Run as HTTP server
dev-env-mcp --mcp-mode --transport http --port 8080

VS Code Integration

Method 1: Direct MCP Integration

Add to .vscode/settings.json:

{
  "mcp.servers": {
    "dev-environment": {
      "command": "dev-env-mcp",
      "args": ["--mcp-mode"],
      "transport": "stdio"
    }
  }
}

Method 2: Task Integration

Add to .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "detect-environment",
      "type": "shell",
      "command": "dev-env-mcp",
      "args": ["detect-environment", "--format", "copilot"],
      "group": "build"
    }
  ]
}

Method 3: Extension Integration

Install the companion VS Code extension:

  1. Open VS Code Extensions (Ctrl+Shift+X)
  2. Search for "Development Environment MCP"
  3. Install and reload VS Code

Copilot Integration

The server provides context-aware assistance for:

  • Terminal Commands: Automatically formats commands for your OS/shell
  • Environment Variables: Correct syntax for setting env vars
  • File Operations: Platform-appropriate file manipulation commands
  • Development Workflows: Context-aware suggestions for common dev tasks

Example Usage with Copilot

User: "Run the tests"
Copilot: (detects Windows PowerShell) "python -m pytest test/"

User: "Run the tests" 
Copilot: (detects Linux) "python3 -m pytest test/"

User: "Set environment variable"
Copilot: (Windows) "$env:PYTHONPATH = 'c:\dev\project'"
Copilot: (Linux) "export PYTHONPATH=/home/user/project"

Available Tools

The MCP server exposes these tools:

detect_environment

Detects current OS, shell, hardware, and provides environment context.

Parameters:

  • format (string): Output format - "json", "summary", "copilot"

get_command_syntax

Provides correct command syntax for the current environment.

Parameters:

  • operation (string): Operation type - "test", "build", "deploy", "install"
  • target (string, optional): Target environment - "local", "remote", "pi"
  • format (string): Output format - "shell", "explanation", "examples"

format_command

Formats a generic command for the current environment.

Parameters:

  • command_template (string): Template command with placeholders
  • variables (object): Variables to substitute in template

get_project_context

Analyzes current project structure and provides relevant context.

Parameters:

  • include_files (boolean): Include file listing in output
  • analyze_dependencies (boolean): Analyze package.json/requirements.txt

Configuration

Environment Variables

  • DEV_ENV_MCP_CONFIG: Path to custom configuration file
  • DEV_ENV_MCP_LOG_LEVEL: Logging level (DEBUG, INFO, WARN, ERROR)
  • DEV_ENV_MCP_CACHE_TTL: Cache TTL for environment detection (seconds)

Custom Configuration

Create a dev-env-mcp.json config file:

{
  "detection": {
    "cache_ttl": 300,
    "enable_hardware_detection": true,
    "custom_environments": {
      "my-docker": {
        "detect_command": "cat /.dockerenv",
        "shell": "bash",
        "python_cmd": "python3"
      }
    }
  },
  "commands": {
    "custom_operations": {
      "my-build": {
        "windows": "msbuild /p:Configuration=Release",
        "linux": "make build",
        "macos": "xcodebuild -configuration Release"
      }
    }
  }
}

Development

Setting Up Development Environment

git clone https://github.com/yourusername/dev-environment-mcp.git
cd dev-environment-mcp
pip install -e ".[dev]"

Running Tests

pytest test/

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
CursorThe AI Code Editor
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic