Fork me on GitHub

Ghostwriter MCP Server

SourceForge Downloads (folder) M8ven Score bindex

Overview

Ghostwriter MCP Server is an executable Java 17 Model Context Protocol (MCP) server. It combines Ghostwriter's project-aware code-assistance workflows with Bindex Core's library-metadata retrieval, registration, and recommendation capabilities, and publishes those capabilities through the Machai MCP Server runtime. MCP clients, IDE integrations, and developer-automation processes can launch the assembled JAR locally over STDIO or connect to the server's HTTP mode.

The org.machanism.machai.mcp.server.McpServer entry point starts the unified server. With no port option it uses STDIO; --port enables HTTP mode, and --session enables streamable HTTP sessions. The server can also receive a project directory, server name, advertised version, and properties configuration through the runtime's command-line options. Its tools support project-aware assistance, model-assisted workflows, dependency metadata discovery, Bindex descriptor retrieval and registration, and library recommendations. The POM declares the Ghostwriter, Bindex Core, and Machai MCP Server runtime modules that provide these capabilities.

The source tree contains no package-info.java files. Accordingly, this overview is based on the Maven project description, declared dependencies, the executable entry point, and the project's Bindex metadata. Ghostwriter model-assisted workflows use the configured generative-AI provider; Bindex workflows use the configured metadata sources and registry services.

Ghostwriter MCP Server component diagram

The diagram is maintained in src/site/puml/c4-diagram.puml. It shows the MCP client, Machai MCP Server runtime, Ghostwriter tools, Bindex Core services, the configured AI provider, and the external metadata and registry systems with which they interact.

Supported AI providers

AI-provider integration is supplied by the transitive Machai Generative AI client used by Ghostwriter. The runtime supports CodeMie, OpenAI, and Anthropic; this project's POM selects CodeMie by default. Choose a provider with genai.serverId, use a compatible provider-qualified model in gw.model, and supply credentials through runtime properties or environment variables rather than committing secrets to the POM.

Provider Status Configuration
CodeMie Project default; chat and embeddings Set genai.serverId=CodeMie and use a CodeMie model such as the default CodeMie:gpt-5.5-2026-04-24. Set GENAI_USERNAME and GENAI_PASSWORD; these may be a user name/password or client ID/client secret. Override AUTH_URL when using a non-default authentication endpoint. CodeMie dispatches supported GPT models through its OpenAI-compatible API and supported Claude models through its Anthropic-compatible API.
OpenAI Supported; chat and embeddings Set genai.serverId=OpenAI, set gw.model to the required OpenAI model, and provide OPENAI_API_KEY. Optionally set OPENAI_BASE_URL for an OpenAI-compatible endpoint.
Anthropic Supported; chat Set genai.serverId=Anthropic, set gw.model to the required Claude model, and provide ANTHROPIC_API_KEY. Optionally set ANTHROPIC_BASE_URL for a compatible endpoint.

Common configuration parameters

Parameter Description Default value in this project
genai.serverId Generative-AI provider identifier used by Ghostwriter. CodeMie
gw.model Provider-qualified model identifier used for Ghostwriter model requests. CodeMie:gpt-5.5-2026-04-24
GENAI_USERNAME / GENAI_PASSWORD CodeMie user credentials or OAuth client credentials. No default; required for CodeMie authentication.
AUTH_URL CodeMie OAuth token endpoint. https://auth.codemie.lab.epam.com/realms/codemie-prod/protocol/openid-connect/token
OPENAI_API_KEY API key used by the OpenAI provider. No default; required when OpenAI is selected.
OPENAI_BASE_URL OpenAI API base URL; also used by CodeMie's OpenAI-compatible path. Provider SDK default for OpenAI; https://codemie.lab.epam.com/code-assistant-api for CodeMie.
ANTHROPIC_API_KEY API key used by the Anthropic provider. No default; required when Anthropic is selected.
ANTHROPIC_BASE_URL Anthropic API base URL; also used by CodeMie's Anthropic-compatible path. Provider SDK default for Anthropic; https://codemie.lab.epam.com/code-assistant-api for CodeMie.
maven.compiler.release Java release used to compile the server artifact. 17
--projectDir / -d Project directory supplied to project-aware server workflows. Runtime-defined; commonly the current project directory.
--port / -p Port that selects HTTP server mode. Not set; no port starts STDIO mode.
--session / -s Enables streamable sessions when HTTP mode is active. Disabled.

Maven properties can be overridden with -D options or in the Maven configuration used to build or run the server. Keep provider credentials out of the POM and source control. See the Machai MCP Server runtime documentation for the complete provider and command-line configuration reference.

Resources