> ## Documentation Index
> Fetch the complete documentation index at: https://harisfazillah.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference: mcp_server.md

> FastMCP Model Context Protocol (MCP) server implementation for the DSOM Palace. Deep State of Mind framework. Deep State of Mind framework.

FastMCP Model Context Protocol (MCP) server implementation for the DSOM Palace.

## Description

The `server.py` utility exposes the Sovereign Markdown Palace, active brain assets, and local OpenWiki knowledge indexes directly to AI clients. It serves context via standard JSON-RPC over `stdio`.

## Script path

`tools/mcp/server.py`

## CLI signature

```bash theme={null}
uv run tools/mcp/server.py

```

## Environment variables

* **DSOM\_ROOT:** Overrides project base directory path. Defaults to parent of script path.

## Resources exposed

AI clients can subscribe to and read these standardised read-only streams:

* **dsom://brain/state:** Output of condensed system state `current_state.dsom`.
* **dsom://brain/task:** Real-time session checklists inside `.agents/brain/task.md`.
* **dsom://brain/walkthrough:** Episodic session walkthrough records.
* **dsom://governance/agents:** Complete 27 Sovereign AI constitutional rules.
* **dsom://openwiki/skeleton:** Subsystem structural hierarchy ranking file.
* **dsom://openwiki/quickstart:** Interactive routing table and system entry-points.

## Tools registered

AI clients can execute these tools dynamically:

* **search\_palace(query):** Text search across `docs/` Markdown files.
* **search\_openwiki(query):** Sub-millisecond OKF metadata search.
* **fetch\_context7\_stream(tokens):** Retrieves URL pointers to external pre-indexed token streams.

## Dependencies

* **mcp\[cli]:** Model Context Protocol Python library.
* **fastmcp:** Modern FastMCP helper wrapper.
* **pyyaml:** YAML loader configuration parser.

***

*Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-08-14*
*Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0*


## Related topics

- [DSOM-MCP-ARCHITECTURE.md - Model Context Protocol Native Server](/governance/dsom-mcp-architecture.md)
- [🛠️ HOWTO: Operating DSOM FastMCP Knowledge Server](/tools/howto-mcp-server.md)
- [Agent Plugins 1.0.0 Specification & DSOM Protocol Integration](/governance/dsom-agent-plugins-specification.md)
- [How-To: Run the FastMCP Server](/how-to/run-fastmcp-server.md)
- [Context7 Semantic Indexer & Local Snippet Search](/skills/context7-indexer.md)
