Files
gregWiki/docs/reference/mcp-server.md
Marvin cfaa5550d4 docs: enhance documentation structure and clarify repository layout
- Updated the README and various documentation files to reflect the new flat layout of the `gregFramework`, emphasizing the direct placement of repositories like `gregMod.<Name>/` and `gregExt.<Name>/` under `gregFramework/`.
- Added details about the `gregModmanager/` and `gregDataCenterExporter/` directories, clarifying their roles and contents.
- Improved descriptions and links throughout the documentation to ensure consistency and accuracy, enhancing user navigation and understanding of the project structure.
- Adjusted language in several sections to better communicate the purpose and organization of the repositories.

This commit improves the overall clarity and usability of the documentation.
2026-04-10 02:03:00 +02:00

65 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: MCP server (LLM-friendly modding)
sidebar_label: MCP server
description: Model Context Protocol server bundled with the docs Docker image for assistants and IDEs.
---
# MCP server (FrikaMF modding)
The **gregCore** repository ships a **Model Context Protocol (MCP)** server at **`gregCore/mcp-server/`** that exposes:
- **Docs search & read** — Markdown under `docs/` (same source as Docusaurus).
- **Hook registry** — `fmf_hooks.json` (and the same registry path in the monorepo).
- **CONTRIBUTING** — conventions and workflow.
- **Repo layout** — static overview and a **`fmf_modding_context`** prompt for quick context.
Use it when you want an assistant (Cursor, Claude Code, or any MCP client) to **ground answers** in this repo instead of guessing APIs.
## Docker (single container)
The root `Dockerfile` builds **Docusaurus** into static files and runs **one Node process** that:
- Serves the wiki at **`http://<host>:3000/`** (static HTML).
- Exposes **Streamable HTTP MCP** at **`POST /mcp`** and **`GET /mcp`** (SSE), plus **`GET /health`**.
From the repo root:
```bash
docker compose up docs-mcp
```
Default mapping: **`http://localhost:3040`** (host) → container port **3000**.
- Docs: `http://localhost:3040/wiki/`
- Health: `http://localhost:3040/health`
- MCP: `http://localhost:3040/mcp` (client must speak MCP Streamable HTTP; session via `mcp-session-id` header).
:::note Security
Binding to `0.0.0.0` exposes the MCP endpoint on your network. Use only on trusted networks or behind a reverse proxy with authentication.
:::
## Local (stdio) for Cursor
Source: **`gregCore/mcp-server/`** (see **`README.md`** in that folder). Install dependencies with `npm install`, then run `node src/index.mjs --stdio --data-root <root>`, where `<root>` is a directory that contains **`docs/`**, **`CONTRIBUTING.md`**, and **`FrikaModFramework/fmf_hooks.json`** (or a flat `fmf_hooks.json`). The READMEs example uses `--data-root ..` relative to `mcp-server/`; in a **split-repo** workspace you may need a different `<root>` or `FMF_MCP_DATA_ROOT` so all three paths resolve.
Point your MCP client at this command (stdio transport).
## Tools (summary)
| Tool | Purpose |
|------|--------|
| `fmf_search_docs` | Substring search across `docs/**/*.md` |
| `fmf_read_doc` | Read one file by path under `docs/` |
| `fmf_list_doc_paths` | Discover Markdown paths |
| `fmf_hook_registry` | Raw `fmf_hooks.json` |
| `fmf_read_contributing` | `CONTRIBUTING.md` |
| `fmf_repo_layout` | Short monorepo overview |
## Related
- [Hook naming](./fmf-hook-naming.md)
- [Hooks catalog](./fmf-hooks-catalog.md)
- [Monorepo target layout](../contributors/monorepo-target-layout.md)