MCP Server with OpenAI-Compatible Model Support
Provides tools to interact with OpenAI-compatible API endpoints for text generation, including streaming responses from models like GPT-4o-mini.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Server with OpenAI-Compatible Model Support Generate a story about a robot."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server with OpenAI-Compatible Model Support
A small, readable Model Context Protocol server that exposes a handful of tools to any MCP client (Goose, Claude Desktop, OpenAI Agents, etc.). It supports both stdio and streamable HTTP transports, and one of its tools streams output from an OpenAI-compatible model.
Tools
Tool | Needs an LLM? | Description |
| No | Reports server status and provider config |
| No | Returns the configured model metadata |
| No | Returns the provided message back |
| No | Lists files/folders at a path on the host machine |
| No | Reads the text contents of a file on the host machine |
| Yes | Streams text from the configured OpenAI-compatible model |
The filesystem tools (list_directory, read_file) only make sense over stdio, because the server runs on the user's own machine and can reach their disk — the canonical "local" MCP use case.
Related MCP server: MCP Server
Architecture
src/server.ts— bootstraps the server, registers tools, selects the transportsrc/config.ts— loads environment configurationsrc/providers/— OpenAI-compatible clientsrc/tools/— one file per tool
Transports
Set MCP_TRANSPORT to choose how clients reach the server:
Value | Behavior |
| The client launches the server as a subprocess and talks over stdin/stdout. Local, single-client. |
| The server listens on a port ( |
| Runs stdio and HTTP simultaneously in one process. |
generate_text streams its tokens as notifications/message. Over HTTP these ride the single request's own SSE response, so the server stays stateless (no session affinity needed).
Setup
npm install
cp .env.example .env # then fill in your provider settings
npm run build
npm startEnvironment variables (see .env.example):
MCP_TRANSPORT=stdio # stdio | http | both
MCP_HTTP_HOST=127.0.0.1
MCP_HTTP_PORT=3000
OPENAI_API_KEY=... # only needed for generate_text
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o-miniTesting with Goose
Goose is an open-source AI agent (by Block) that speaks MCP. It uses its own LLM as the "brain" to decide which of your tools to call. See the Goose docs and repo.
1. Give Goose a brain (its own LLM)
Goose needs an LLM provider — this is separate from this server's OPENAI_* config. Using Anthropic as an example, run it inline so the values reach Goose:
export GOOSE_DISABLE_KEYRING=1 # read secrets from env instead of the OS keychain
export GOOSE_PROVIDER=anthropic
export GOOSE_MODEL=claude-sonnet-4-6
export ANTHROPIC_API_KEY=sk-ant-...(Or run goose configure to store these in the keychain once.)
2. Launch a session with this server attached
npm run build
goose session --with-extension 'node /absolute/path/to/dist/server.js'Goose calls MCP servers extensions; the tools appear namespaced (e.g. echo, list_directory).
To test the HTTP transport instead, start the server first and point Goose at the URL:
# terminal 1
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 node dist/server.js
# terminal 2
goose session --with-streamable-http-extension 'http://127.0.0.1:3000/'3. Ask in plain English — the brain picks the tool
You don't name the tool; Goose decides:
echo the words "it works"
list the files in /absolute/path/to/src/tools
read the package.json in this project and tell me the version
what model is the server configured to use?
is the server healthy?Note: the agent may sometimes prefer one of its own built-in tools over yours (e.g. it may run a shell
lsinstead oflist_directory). That's the brain choosing — phrase the request toward your tool, or disable conflicting built-ins, if you want to force it.
Screenshots
echo — Goose's brain calls the echo tool and reports the result:

Listing files in the project:

Inspecting without an agent
To poke the server directly (no LLM needed):
# Browser UI:
npx @modelcontextprotocol/inspector node dist/server.js
# Raw JSON-RPC over HTTP (server in http mode):
curl -s -X POST http://127.0.0.1:3000/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Example stdio client config
{
"mcpServers": {
"mcp-openai-server": {
"command": "node",
"args": ["/absolute/path/to/dist/server.js"],
"env": {
"OPENAI_API_KEY": "your-key",
"OPENAI_BASE_URL": "https://api.openai.com/v1",
"OPENAI_MODEL": "gpt-4o-mini"
}
}
}
}Available Tools
6 toolsechoA
Returns the provided message back. Useful for testing the connection.
Inputs: message (required).
generate_textC
Generate text using the configured OpenAI-compatible model.
Inputs: prompt (required), model, temperature, maxTokens.
list_directoryB
Lists the files and folders at a path on the machine running this server.
Inputs: path (required).
list_modelsB
Returns the currently configured model metadata for the MCP server.
Inputs: details.
read_fileB
Reads and returns the text contents of a file on the machine running this server.
Inputs: path (required).
server_healthC
Checks whether the MCP server and provider configuration are ready.
Inputs: includeConfig.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
All six tools have clearly distinct purposes: echo is for testing, generate_text for model generation, list_directory and read_file for file operations, list_models for model metadata, and server_health for checking configuration. There is no overlap or ambiguity.
Most tools follow a verb_noun pattern (generate_text, list_directory, list_models, read_file), but echo is a single verb and server_health is a noun phrase, breaking consistency. The pattern is still readable but not uniform.
With six tools, the count is reasonable for an MCP server. However, the server's stated focus on OpenAI-compatible model support is somewhat diluted by the inclusion of file system tools (list_directory, read_file), which slightly reduces the sense of a well-scoped set.
For a server claiming OpenAI-compatible model support, the tool surface is notably sparse: only a single generate_text tool and a list_models tool. Missing capabilities like context management, streaming, or role-based chat severely limit model interaction. File access is also one-sided (read only).
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that extends AI capabilities by providing file system access and management functionalities to Claude or other AI assistants.277 npm5-
- FlicenseNot gradedqualityNot gradedmaintenanceProvides remote filesystem operations, git repository management, and process execution capabilities for AI agents through the Model Context Protocol.-
- FlicenseNot gradedqualityDmaintenanceA secure Model Context Protocol server providing HTTP endpoints for AI agent tool execution, including file system operations, shell commands, and LLM-based code generation.1-
- FlicenseNot gradedqualityDmaintenanceEquips AI coding agents with filesystem, Git, database, and computation tools via the Model Context Protocol.1-