xamp

xamp

MCP server that gives Claude Code and OpenCode direct access to your XAMPP MariaDB/MySQL databases, enabling database listing, table inspection, and read/write query execution.

Category
访问服务器

README

MCP-XAMP

MCP server that gives Claude Code and OpenCode direct access to your XAMPP MariaDB/MySQL databases. Five tools: list databases, list tables, describe table, read query, write query.

Quick Start

  1. Clone the repo
  2. Configure your AI agent (Claude Code or OpenCode)
  3. Start queryinglist_databases, read_query, etc.

No global install needed — runs directly with uv run.


Requirements

  • Python 3.13+
  • XAMPP with MariaDB/MySQL running on localhost:3306
  • uv

Installation

git clone https://github.com/<user>/mcp-xamp.git
cd mcp-xamp
uv sync

Verify it works:

uv run mcp-xamp

Optional: install globally

If you prefer mcp-xamp available as a command anywhere:

uv tool install --python 3.13 .

Then use "command": "mcp-xamp" instead of uv run --directory ... in the configs below.


Claude Code Setup

Option A: global install (recomendado)

Instala mcp-xamp como comando global y registralo en Claude Code:

uv tool install --python 3.13 .

Luego agregá el server MCP. Elegí el scope que prefieras:

# Scope project (crea .mcp.json en el directorio actual)
claude mcp add xamp \
  -e MCP_XAMP_HOST=localhost \
  -e MCP_XAMP_PORT=3306 \
  -e MCP_XAMP_USER=root \
  -e MCP_XAMP_PASSWORD= \
  -e MCP_XAMP_ALLOW_WRITE=true \
  -- mcp-xamp

# Scope user (disponible en todos tus proyectos)
claude mcp add --scope user xamp \
  -e MCP_XAMP_HOST=localhost \
  -e MCP_XAMP_PORT=3306 \
  -e MCP_XAMP_USER=root \
  -e MCP_XAMP_PASSWORD= \
  -e MCP_XAMP_ALLOW_WRITE=true \
  -- mcp-xamp

Ajusta los valores de las variables según tu instalacion de XAMPP.

Option B: sin instalar (usando uv run)

Si preferis no instalar globalmente, apunta al directorio del repo:

claude mcp add xamp \
  -e MCP_XAMP_HOST=localhost \
  -e MCP_XAMP_PORT=3306 \
  -e MCP_XAMP_USER=root \
  -e MCP_XAMP_PASSWORD= \
  -e MCP_XAMP_ALLOW_WRITE=true \
  -- uv run --directory /ruta/a/mcp-xamp mcp-xamp

Reemplaza /ruta/a/mcp-xamp con la ruta real donde clonaste el repo.

Config manual (archivo .mcp.json)

Si preferis editar el archivo a mano, tambien funciona:

{
  "mcpServers": {
    "xamp": {
      "command": "mcp-xamp",
      "args": [],
      "env": {
        "MCP_XAMP_HOST": "localhost",
        "MCP_XAMP_PORT": "3306",
        "MCP_XAMP_USER": "root",
        "MCP_XAMP_PASSWORD": "",
        "MCP_XAMP_ALLOW_WRITE": "true"
      }
    }
  }
}

Si no instalaste globalmente, usa "command": "uv" con los args correspondientes (ver el .mcp.json de este repo como referencia).

Verify

Dentro de Claude Code, corre /mcp para confirmar que xamp aparece como conectado. Despues proba:

List all databases on my XAMPP server.

OpenCode Setup

Config location

OpenCode reads MCP config from opencode.json or opencode.jsonc. The file can be in:

Location Scope
<project-root>/opencode.json Project-specific
<project-root>/.opencode/opencode.json Project-specific (alt)
~/.config/opencode/opencode.json Global (all projects)

Add the MCP server

Add this block to your opencode.json or opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "xamp": {
      "type": "local",
      "command": ["uv", "run", "--directory", "/path/to/mcp-xamp", "mcp-xamp"],
      "enabled": true,
      "environment": {
        "MCP_XAMP_ALLOW_WRITE": "true"
      }
    }
  }
}

Replace /path/to/mcp-xamp with your actual clone path.

If you used uv tool install, simplify to:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "xamp": {
      "type": "local",
      "command": ["mcp-xamp"],
      "enabled": true,
      "environment": {
        "MCP_XAMP_ALLOW_WRITE": "true"
      }
    }
  }
}

Verify

Restart OpenCode, then try:

Show me all databases on the xamp server. use xamp tools

Environment Variables

All configuration goes through environment variables. Sensible defaults for a standard XAMPP installation.

Variable Default Description
MCP_XAMP_HOST 127.0.0.1 MariaDB/MySQL host
MCP_XAMP_PORT 3306 MariaDB/MySQL port
MCP_XAMP_USER root Database user
MCP_XAMP_PASSWORD (empty) Database password
MCP_XAMP_ALLOW_WRITE false Set to true to enable INSERT/UPDATE/DELETE/DDL

Credentials are read from environment variables only. They never appear in tool arguments, log output, or error messages.


Tools

Tool Description Requires
list_databases Show all accessible databases
list_tables Show tables in a database database
describe_table Show columns, types, and keys database, table
read_query Execute SELECT / SHOW / DESCRIBE / EXPLAIN database, query
write_query Execute INSERT / UPDATE / DELETE / DDL database, query, MCP_XAMP_ALLOW_WRITE=true

Security

  • Read-only by default. Write operations require MCP_XAMP_ALLOW_WRITE=true.

  • Credentials never logged. Host, port, user, and password are stripped from error messages.

  • Credentials only from env vars. No tool parameters, no config files, no CLI args.

  • Connection-per-query. Each tool invocation opens and closes its own connection — no shared state, no stale connections.

  • XAMPP default is root with no password. Create a dedicated user for production use:

    CREATE USER 'mcp_agent'@'127.0.0.1' IDENTIFIED BY 'secure_password';
    GRANT SELECT ON *.* TO 'mcp_agent'@'127.0.0.1';
    

Development

# Install dev dependencies
uv sync --group dev

# Run tests
uv run pytest -v --cov=src/mcp_xamp

# Lint
uv run ruff check src/ tests/

# Format
uv run ruff format src/ tests/

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选