Skip to main content

harold-mcp

Harold logo

Harold MCP tools:

What is this?

harold-mcp is an MCP server that gives AI coding assistants tools for working with the Maude specification and verification language.

Harold MCP Tools

  • maude_program_diagnostics(path) — diagnoses a Maude source file by loading it into the Maude interpreter and reporting every problem it finds, including warnings Maude can recover from. Returns a structured, LSP-style result: a success flag (true only when the file loads with no warnings and no errors), per-severity counts, and one diagnostic per problem with a 1-based line range (range is null for whole-file problems). Use it to check whether a Maude program is well formed, and to get a list of issues to fix.

Planned tools: running Maude programs, and a vector index of the Maude documentation for retrieval-augmented generation (RAG).

Installation

An installer is still to be developed. For now you need to download the code and run make install.

Then setup the harold-mcp command defined on pyproject.toml as an MCP server for your IDE, using the command full path. For example, for Zed add the following to ~/.config/zed/settings.json:

  "context_servers": {
    "harold": {
      "enabled": true,
      "remote": false,
      "command": "/home/juanrh/git/demiourgoi/Harold/harold-mcp/.venv/bin/harold-mcp",
      "args": [],
      "env": {}
    }
  },
  ...

for opencode (useful for automated testing) add the following to ~/.config/opencode/opencode.jsonc:

  "mcp" : {
    "harold": {
      "type": "local",
      "command": ["/home/juanrh/git/demiourgoi/Harold/harold-mcp/.venv/bin/harold-mcp"],
      "enabled": true,
      "environment": {}
    }
  }

for Cline (useful for manual testing and Maude programming) add the following to ~/.cline/data/settings/cline_mcp_settings.json:

  "mcpServers" : {
    "harold": {
      "command": "/home/juanrh/git/demiourgoi/Harold/harold-mcp/.venv/bin/harold-mcp",
      "args": [],
      "disabled": false,
      "autoApprove": [],
      "env": {}
    }
  }

For production, harold-mcp will be distributed as a Python package and run with uvx.

Configuration

The server is configured through environment variables (HAROLD_* prefix) set in the MCP server configuration:

Env var Meaning Default
HAROLD_MAUDE_WORKERS Number of Maude worker processes. Diagnostics run in parallel across workers; more workers use more memory (each creates its own Maude interpreter). 1
HAROLD_MAUDE_WORKER_TIMEOUT_SECS Seconds to wait for each worker call before failing it as timed out. 60

Invalid values (e.g. HAROLD_MAUDE_WORKERS=0) make the server fail fast at startup.

Developer guide

Development environment setup

Install the environment with

make install

# code validations
make check test

# run all CI checks before pushing a code change
make release

# run the MCP server over stdio transport
make run
# or directly:
# uv run harold-mcp

This will also generate your uv.lock file.

Recommendations

  • In case you are using the Zed IDE, it is also recommended to clone https://github.com/fadoss/maude-bindings, and add it to the Zed project together with the root folder of this file, so it is available to coding agents.
  • Cline is great for debugging tool behaviour, because it displays the full JSON response from each tool call.
  • Setup the following agent skills:
    • codebase-summary: copy the corresponding agent SOP to ~/.agents/skills/codebase-summary/SKILL.md, and add the following frontmatter
---
name: codebase-summary
description: Generates structured codebase documentation — architecture, components, interfaces, data models, workflows — into `.agents/summary/`, and produces consolidated files like `AGENTS.md`, `README.md`, or `CONTRIBUTING.md`. Use when the user asks to document, summarize, understand, or onboard to a codebase.
---
  • pdd: copy the corresponding agent SOP to ~/.agents/skills/pdd/SKILL.md, and add the following frontmatter
---
name: pdd
description: Transforms a rough idea into a detailed design document, implementation plan, and actionable todo list using the Prompt-Driven Development (PDD) methodology. Use when a user describes a project concept or feature idea they want to develop, when they need to flesh out requirements and research before coding, or when they ask to plan, design, or create a structured specification for a new project.
---

Releasing a new version

One time setup:

  • Create an API Token on PyPI.
  • Add the API Token to your projects secrets with the name PYPI_TOKEN by visiting this page.

New release process:

  1. Create a new release on Github.
    1. Make sure make release passes and CI checks are passing.
    2. Set tag to a new tag in the form *.*.* for the current version on pyproject.toml, removing the ".dev0" suffix. Use "Create new tag on publish".
    3. Set target to main. Note the release GH workflow will patch pyproject.toml to use the version specified in the previous step, irrespective of the versión that appears in the main branch
    4. Use the CHANGELOG.md entry for that version for the release notes
    5. Add the pre-release label as required, and any suitable binaries
    6. Click "Publish release"
    7. Watch it run under the Actions tab → release-main. Success means the package is on PyPI and docs are live. Confirm all went well on https://pypi.org/project/harold-mcp/
  2. New the version on pyproject.toml so the tip of main is the code for the next release, still WIP. Also add a new entry on CHANGELOG.md for the new version (without the the ".dev0" suffix).

Note:

  • PyPI versions are immutable — you can never re-upload or fix a released version. If a release fails after a partial publish, you must bump to 0.0.4 (or use a dev suffix).

References


Repository initiated with osprey-oss/cookiecutter-uv.

Release files for harold-mcp 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harold-mcp 0.0.2
File Size Uploaded
harold_mcp-0.0.2.tar.gz 256.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for harold-mcp 0.0.2
File Interpreter ABI Platform
harold_mcp-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 327.8 kB

Release files / harold_mcp-0.0.2.tar.gz

Download URL harold_mcp-0.0.2.tar.gz
Size 256.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5e280b3d6a05b921d83a5aee2011f9d93902aef1a62122ab35ab19dfe9701b52
BLAKE2b-256 checksum
How to use checksums
bcee012008bbff75d68be4ab7b87289ad46cc2b2bf2d4cafeb6d05a437564a86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / harold_mcp-0.0.2-py3-none-any.whl

Download URL harold_mcp-0.0.2-py3-none-any.whl
Size 71.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
920aea4c352580e5cffc6d0bfc41801c3673756b2f5df096e8760ef36d0495e9
BLAKE2b-256 checksum
How to use checksums
fb64213eb641772289c069fe41d62f51840ed20f9e169a901b06d85b84ca6304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.0.3

2 release files

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page