Skip to main content

FOCAL MCP Server (Framework for Orchestrated Central AI ruLes)

Project description

FOCAL MCP Server

FOCAL MCP (Framework for Orchestrated Central AI ruLes) is a local MCP server that centralizes AI behavior rules and injects them across tools like Codex, Claude Code, and Cursor.

What This Server Does

  • Stores rules in a user home workspace: ~/.focal_mcp/workspace
  • Serves a web UI to edit rules as files
  • Exposes MCP prompts/resources + list_changed notifications
  • Provides a focal_rules tool so agents can fetch the latest rules before every response

Project Layout (Refactored)

FOCAL-MCP/
  README.md
  SPEC.md
  agents.md
  pyproject.toml
  src/
    focal_mcp_server/
      app.py
      mcp.py
      notifications.py
      web.py
      workspace.py
      logging_utils.py

Quick Start

uvx --from . focal-mcp-server

Web UI:

http://127.0.0.1:8765

MCP endpoint:

http://127.0.0.1:8765/mcp

WebSocket notifications:

ws://127.0.0.1:8765/mcp/ws

Workspace

Rules are stored outside the repo:

~/.focal_mcp/workspace/
  core/
    system.md
    style.md
    safety.md
    tool_policy.md
  agents/

MCP Behavior

  • initialize returns instructions that include a runtime directive to call focal_rules before every response.
  • tools/list exposes focal_rules which returns the latest rules from disk.
  • Rule changes trigger:
    • notifications/prompts/list_changed
    • notifications/resources/list_changed

Project Prompt (Codex)

The repository-level prompt for Codex lives in:

agents.md

Development Notes

  • This project uses a src/ layout for the Python package.
  • Use SPEC.md as the single source of truth for behavior, interfaces, and constraints.

Roadmap (Next)

  • Manage rules per project when working across multiple repos
  • UI/UX improvements for rule editing and visibility

Publish to PyPI (Option A)

  1. Create a PyPI token with scope for this project.
  2. Add the token to GitHub repository secrets as PYPI_API_TOKEN.
  3. Tag and push a release:
git tag v0.1.0
git push origin v0.1.0

GitHub Actions will build and publish automatically.

Once published, users can run:

uvx --from focal-mcp-server focal-mcp-server

Install & Run with uvx

After the package is published to PyPI, anyone can run it without cloning the repo:

uvx --from focal-mcp-server focal-mcp-server

This will download the latest release and start the server.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

focal_mcp_server-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

focal_mcp_server-0.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file focal_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: focal_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for focal_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 18f3ce51b734feb30eef2f787a4e6d0bcd30b1954f1aada63390cfcd724c5ca3
MD5 72392d8b34a94f09101b703d4da88d43
BLAKE2b-256 c5bdf04be57a3af01d12162793c87be510564452106708cb098e0185e6990a10

See more details on using hashes here.

File details

Details for the file focal_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for focal_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b9045af84638bdbce4ac6a8742e0467fccc051caaf48cb87ccdbdc33c19b3bf
MD5 fe4f215ada02ee42711e26674328cea9
BLAKE2b-256 7f07cd913b6165cc024cadf43d8c3474a3279807f5cb91651e5838514249597a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page