# enmanuelmag/heimdall-mcp [Health: Active]

**Category:** 📊 Monitoring  
**Repository:** https://github.com/enmanuelmag/heimdall-mcp  
**GitHub Stars:** 11  
**npm Downloads (last month):** 66  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/enmanuelmag-heimdall-mcp

## Description
Transparent proxy for any MCP server that intercepts all JSON-RPC messages, measures latency, and stores traces in SQLite, PostgreSQL, or MySQL. Exports OpenTelemetry (OTLP) spans to Jaeger, Tempo, or Grafana. Supports stdio, HTTP, and SSE transports. npx @cardor/heimdall-mcp

## Tools
Capabilities this server exposes over MCP:

- **read_file** — Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.
- **read_text_file** — Read the complete contents of a file from the file system as text. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Use the 'head' parameter to read only the first N lines of a file, or the 'tail' parameter to read only the last N lines of a file. Operates on the file as text regardless of extension. Only works within allowed directories.
- **read_media_file** — Read a file and return it as a base64-encoded content block with its MIME type. Image and audio files are returned as image/audio content; any other file type is returned as an embedded resource. Only works within allowed directories.
- **read_multiple_files** — Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.
- **write_file** — Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.
- **edit_file** — Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.
- **create_directory** — Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories.
- **list_directory** — Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.
- **list_directory_with_sizes** — Get a detailed listing of all files and directories in a specified path, including sizes. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is useful for understanding directory structure and finding specific files within a directory. Only works within allowed directories.
- **directory_tree** — Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories.
- **move_file** — Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.
- **search_files** — Recursively search for files and directories matching a pattern. The patterns should be glob-style patterns that match paths relative to the working directory. Use pattern like '*.ext' to match files in current directory, and '**/*.ext' to match files in all subdirectories. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.
- **get_file_info** — Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.
- **list_allowed_directories** — Returns the list of directories that this server is allowed to access. Subdirectories within these allowed directories are also accessible. Use this to understand which directories and their nested paths are available before trying to access files.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "heimdall-mcp": {
    "command": "npx",
    "args": ["-y","@cardor/heimdall-mcp"]
  }
}
```

## Documentation

## What enmanuelmag/heimdall-mcp MCP server does

enmanuelmag/heimdall-mcp MCP server operates as a transparent proxy for an existing MCP server. It receives requests from an MCP client, applies optional policy checks, forwards permitted messages to the configured target, and returns the target response. The original server does not need to be modified.

Each JSON-RPC request and response is captured as a trace span containing timing information, attributes, and message bodies. Traces can be persisted in SQLite, PostgreSQL, or MySQL. The proxy can also send OpenTelemetry spans through OTLP to systems including Jaeger, Tempo, or Grafana.

Access rules can be defined per server for tools, prompts, and resources. Policies can allow or deny names, restrict resource patterns, and constrain tool arguments. Path-aware rules can help prevent traversal and symlink escapes, while warning-only rules record violations without blocking the call.

## How it works

The MCP client connects to the proxy through stdio. The proxy then selects the transport needed by the wrapped server: stdio for a subprocess, HTTP for a remote HTTP endpoint, or SSE for a remote SSE endpoint. Interceptors measure traffic, evaluate policy, forward allowed calls, and write trace data.

When both global and project-level policy files exist, the stricter result applies. Denials are combined, allowed items must pass both configurations, and a denial takes precedence over an allow rule. This lets a global policy establish restrictions that a project configuration cannot loosen.

The package can be used from the command line or as a developer library. The repository documents CLI operations for starting the proxy, initializing configuration, and checking health.

## Setup and configuration

Install the package globally or add it to a project with npm. The documented package name is `@cardor/heimdall-mcp`, and it can be launched with the corresponding CLI or used as a project dependency.

Configuration files are optional. The proxy looks for `heimdall.config.ts`, `.js`, `.mjs`, `.cjs`, or `.json` in the project directory, and for a matching file under `~/.config/heimdall/`. TypeScript configuration is loaded without a separate compilation step. Server-specific entries are selected by the configured server name or the name returned during initialization.

The repository supports SQLite, PostgreSQL, and MySQL trace stores, plus OTLP export.

## Tools and capabilities

enmanuelmag/heimdall-mcp MCP server exposes filesystem-oriented MCP tools through the wrapped server, including reading text or media files, reading multiple files, writing and editing files, creating directories, moving files, listing directories, searching paths, inspecting file metadata, viewing directory trees, and listing allowed directories.

The file operations are restricted to allowed directories. Text reads support optional head or tail limits, media reads return base64 content with MIME information, and edits return a git-style diff. The tool list also includes a deprecated `read_file` operation; `read_text_file` is the preferred replacement.

Proxy-level capabilities include latency measurement, JSON-RPC interception, trace storage, OTLP span export, tool and resource policy enforcement, argument constraints, and resource locks for coordinating concurrent tool calls.

## Limitations and notes

The proxy exposes stdio to its MCP client even when the wrapped server uses HTTP or SSE. Policy behavior depends on the configuration file and server name being resolved correctly. Without policy files, the proxy remains transparent rather than imposing default restrictions.

The listed filesystem tools only operate within configured allowed directories. Write and move operations can alter or replace files, so policies should be reviewed before exposing them to an agent. `read_file` is deprecated in favor of `read_text_file`.

_Full upstream README: https://allmcps.com/mcp/enmanuelmag-heimdall-mcp/readme_

