Skip to content
Skillv1.0.0

mcp-server-windows

Use when building MCP servers for Windows environments.

by LoopyLuci(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from LoopyLuci/Skills (skills/mcp-server-windows/SKILL.md). Install upstream with npx skills add LoopyLuci/Skills --skill mcp-server-windows. Copyright stays with the author.

MCP Server Windows

Building and deploying MCP (Model Context Protocol) servers on Windows.

What is MCP

MCP is a protocol for exposing tools and resources to AI agents. An MCP server runs as a subprocess of the agent and communicates via stdio or SSE.

Basic MCP Server (Python)

# mcp_server.py
import sys
import json

def main():
    """Simple stdio-based MCP server that exposes tools."""
    # Initialize
    init_msg = json.loads(sys.stdin.readline())
    assert init_msg["method"] == "initialize"

    # Send capabilities
    response = {
        "jsonrpc": "2.0",
        "id": init_msg["id"],
        "result": {
            "protocolVersion": "2024-11-05",
            "capabilities": {
                "tools": {
                    "listTools": {
                        "tools": [
                            {
                                "name": "read_file",
                                "description": "Read a file from disk",
                                "inputSchema": {
                                    "type": "object",
                                    "properties": {
                                        "path": {"type": "string"}
                                    },
                                    "required": ["path"]
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
    sys.stdout.write(json.dumps(response) + "\n")
    sys.stdout.flush()

    # Handle requests
    while True:
        line = sys.stdin.readline()
        if not line:
            break
        req = json.loads(line)

        if req["method"] == "tools/call" and req["params"]["name"] == "read_file":
            path = req["params"]["arguments"]["path"]
            try:
                with open(path, 'r') as f:
                    content = f.read()
                result = {"content": [{"type": "text", "text": content}]}
            except Exception as e:
                result = {"isError": True, "content": [{"type": "text", "text": str(e)}]}

            resp = {
                "jsonrpc": "2.0",
                "id": req["id"],
                "result": result
            }
            sys.stdout.write(json.dumps(resp) + "\n")
            sys.stdout.flush()

if __name__ == "__main__":
    main()

Configuration (Hermes Config)

# In config.yaml
mcp_servers:
  my-mcp-server:
    command: python
    args:
      - "path/to/mcp_server.py"
    env:
      PYTHONUNBUFFERED: "1"
    description: "Local file system tools"

Test the MCP Server

# Send init message
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | python mcp_server.py

# Or use the MCP Inspector
npx @modelcontextprotocol/inspector python mcp_server.py

Windows-Specific Considerations

# Path handling -- normalize for Windows
$path = $args.path -replace '/', '\'

# Long paths -- ensure app.manifest has longPathAware
# Or use \\?\ prefix for paths over 260 chars

# Process lifecycle -- MCP server is managed by the agent
# Ensure clean exit on stdin EOF

Pitfalls

  • Stdio MCP requires unbuffered output -- set PYTHONUNBUFFERED=1 or -u flag
  • Process lifecycle -- MCP server starts/stops with the agent; handle cleanly
  • Path normalization -- MCP clients may send forward-slash paths even on Windows
  • Timeout -- long operations should use progress notifications or background tasks
  • Security -- MCP servers run as the agent user; restrict tool access appropriately

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/loopyluci-skills-mcp-server-windows/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

loopyluci-skills-mcp-server-windows.ocm.jsonjson
{
  "ocm": "1",
  "id": "loopyluci-skills-mcp-server-windows",
  "kind": "skill",
  "name": "mcp-server-windows",
  "description": "Use when building MCP servers for Windows environments.",
  "publisher": "LoopyLuci",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "mcp",
      "server",
      "windows",
      "tool",
      "agent",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Use when building MCP servers for Windows environments."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/LoopyLuci/Skills",
      "path": "skills/mcp-server-windows/SKILL.md",
      "ref": "6f9faf8a3a216cddd3eda96a6c6b93c00710fa5b",
      "url": "https://github.com/LoopyLuci/Skills/blob/6f9faf8a3a216cddd3eda96a6c6b93c00710fa5b/skills/mcp-server-windows/SKILL.md",
      "key": "LoopyLuci/Skills/skills/mcp-server-windows/SKILL.md"
    }
  },
  "instructions": "# MCP Server Windows\n\nBuilding and deploying MCP (Model Context Protocol) servers on Windows.\n\n## What is MCP\n\nMCP is a protocol for exposing tools and resources to AI agents. An MCP server runs as a subprocess of the agent and communicates via stdio or SSE.\n\n## Basic MCP Server (Python)\n\n```python\n# mcp_server.py\nimport sys\nimport json\n\ndef main():\n    \"\"\"Simple stdio-based MCP server that exposes tools.\"\"\"\n    # Initialize\n    init_msg = json.loads(sys.stdin.readline())\n    assert init_msg[\"method\"] == \"initialize\"\n\n    # Send capabilities\n    response = {\n        \"jsonrpc\": \"2.0\",\n        \"",
  "cost": {
    "context_tokens": 923
  }
}

Fetch it by URL: GET /api/v1/registry/loopyluci-skills-mcp-server-windows/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.