MCP ExplorerExplorer

Ghostwriter

@kaquon 15 days ago
1 MIT
FreeCommunity
AI Systems
MCP server for working on files

Overview

What is Ghostwriter

Ghostwriter is an MCP server designed for file editing operations, allowing users to read, edit, and list files in a specified working directory through HTTP endpoints.

Use cases

Use cases include web applications that need to edit configuration files, collaborative tools for editing documents, and backend services that manage file storage and retrieval.

How to use

To use Ghostwriter, build the server using ‘go build ./cmd/file-editor’, then run it with the ‘-dir’ flag to specify the working directory and choose either ‘http’ or ‘stdio’ transport. For example: ‘./file-editor -dir /path/to/workdir -transport http -port 8080’.

Key features

Key features include HTTP endpoints for file operations, support for JSON-RPC STDIO mode, health check endpoint, and graceful shutdown on termination signals.

Where to use

Ghostwriter can be used in various fields such as software development for file management, collaborative editing environments, and any application requiring remote file access and manipulation.

Content

File Editing Server

This repository contains a small file editing server written in Go. The server exposes a single /mcp HTTP endpoint that accepts JSON-RPC requests for file operations. A JSON-RPC STDIO mode is also available.

Building

go build ./cmd/file-editor

This will produce a file-editor binary in the current directory.

Running

The server requires a working directory for file operations. Use the -dir flag to specify it. Choose http or stdio transport with -transport (defaults to http).

Example running the HTTP server on port 8080:

./file-editor -dir /path/to/workdir -transport http -port 8080

You can then send a JSON-RPC request to the /mcp endpoint:

curl -X POST -H 'Content-Type: application/json' \
    -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
    http://localhost:8080/mcp

The server logs initialization information and will shut down gracefully on SIGTERM or Ctrl+C.

Testing

Run the unit tests to verify the server’s behavior:

go test ./...

Tools

No tools

Comments