Skip to content

feat(docs): add MCP Server documentation and configuration#7

Open
escapeboy wants to merge 1 commit intotweakphp:mainfrom
escapeboy:feature/mcp-server
Open

feat(docs): add MCP Server documentation and configuration#7
escapeboy wants to merge 1 commit intotweakphp:mainfrom
escapeboy:feature/mcp-server

Conversation

@escapeboy
Copy link
Copy Markdown

  • Add comprehensive MCP Server documentation page with setup instructions
  • Include configuration guides for Claude Desktop, Cursor, and custom MCP clients
  • Document all five available MCP tools: execute_php, execute_with_loader, get_execution_history, switch_connection, and get_php_info
  • Add detailed examples for each connection type: local, Docker, SSH, Kubernetes, and Vapor
  • Include troubleshooting section and common workflows
  • Add MCP Server navigation link to VitePress config
  • Add MCP server icon (mcp.svg) to public assets
  • Update package-lock.json with dependency changes

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 25, 2025

Deploy Preview for tweakphp ready!

Name Link
🔨 Latest commit 63e2234
🔍 Latest deploy log https://app.netlify.com/projects/tweakphp/deploys/6925770d8875e50008d41a40
😎 Deploy Preview https://deploy-preview-7--tweakphp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@escapeboy
Copy link
Copy Markdown
Author

Docs need updating — Claude Desktop config is incorrect

The current Claude Desktop configuration example requires Node.js to be installed on the user's machine:

{
  "mcpServers": {
    "tweakphp": {
      "command": "node",
      "args": ["-e", "require('http').request(...)"],
      "env": {}
    }
  }
}

This is exactly the problem reported by users in tweakphp/tweakphp#202 — the MCP server runs inside Electron's bundled Node.js, so no system Node.js is required. The transport is Streamable HTTP, not stdio.

Correct configuration

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "tweakphp": {
      "url": "http://127.0.0.1:3000/mcp",
      "type": "http"
    }
  }
}

Cursor (.cursor/mcp.json or global config):

{
  "mcpServers": {
    "tweakphp": {
      "url": "http://127.0.0.1:3000/mcp",
      "type": "http"
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "tweakphp": {
      "url": "http://127.0.0.1:3000/mcp",
      "type": "http"
    }
  }
}

Custom MCP Client section

The TypeScript example uses StdioClientTransport which is wrong. The server speaks Streamable HTTP:

import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'

const client = new Client({ name: 'my-agent', version: '1.0.0' })

await client.connect(new StreamableHTTPClientTransport(
  new URL('http://127.0.0.1:3000/mcp')
))

Summary of required changes in docs/mcp-server.md

  1. Replace the "command": "node" Claude Desktop config with "url" + "type": "http"
  2. Fix the Cursor config (it's already correct — just verify the path note)
  3. Replace StdioClientTransport with StreamableHTTPClientTransport in the custom client example
  4. Add a note that no Node.js installation is required — the server runs inside the TweakPHP app

- Add comprehensive MCP Server documentation page with setup instructions
- Include configuration guides for Claude Desktop, Cursor, and custom MCP clients
- Document all five available MCP tools: execute_php, execute_with_loader, get_execution_history, switch_connection, and get_php_info
- Add detailed examples for each connection type: local, Docker, SSH, Kubernetes, and Vapor
- Include troubleshooting section and common workflows
- Add MCP Server navigation link to VitePress config
- Add MCP server icon (mcp.svg) to public assets
- Update package-lock.json with dependency changes
@escapeboy escapeboy force-pushed the feature/mcp-server branch from 63e2234 to fb59f1b Compare March 28, 2026 16:17
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 28, 2026

Deploy Preview for tweakphp ready!

Name Link
🔨 Latest commit fb59f1b
🔍 Latest deploy log https://app.netlify.com/projects/tweakphp/deploys/69c7ff02228462000878d61c
😎 Deploy Preview https://deploy-preview-7--tweakphp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@escapeboy
Copy link
Copy Markdown
Author

Updated: correct client configuration examples

Based on the investigation in tweakphp/tweakphp#202, the Claude Desktop configuration example in this PR was incorrect — it used "command": "node" which requires Node.js on the user's machine. This is exactly the root cause of the reported failures.

The MCP server runs inside Electron's bundled Node.js — no system Node.js is needed. The transport is Streamable HTTP.

Changes made to docs/mcp-server.md

Claude Desktop — replaced stdio/node approach with HTTP URL config:

{
  "mcpServers": {
    "tweakphp": {
      "url": "http://127.0.0.1:3000/mcp",
      "type": "http"
    }
  }
}

Cursor — same HTTP URL pattern (.cursor/mcp.json or global ~/.cursor/mcp.json):

{
  "mcpServers": {
    "tweakphp": {
      "url": "http://127.0.0.1:3000/mcp",
      "type": "http"
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "tweakphp": {
      "url": "http://127.0.0.1:3000/mcp",
      "type": "http"
    }
  }
}

Custom MCP Client — replaced StdioClientTransport with StreamableHTTPClientTransport:

import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'

const client = new Client({ name: 'my-agent', version: '1.0.0' })
await client.connect(new StreamableHTTPClientTransport(
  new URL('http://127.0.0.1:3000/mcp')
))

Also added a note that no Node.js installation is required on the host machine.

Also resolved the package-lock.json conflict after rebasing on upstream/main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant