Skip to content

Conversation

@kgprs
Copy link
Contributor

@kgprs kgprs commented Oct 28, 2025

Summary

Adds a docker mcp server init --template=<X> command that scaffolds an MCP server project given a template name. This PR contains two templates: "basic" and "chatgpt-app-basic".

docker mcp server init my-server --template=basic
docker mcp server init my-chatgpt-app --template=chatgpt-app-basic

Example Usage

Create, build and run a new ChatGPT app:

docker mcp server init --template=chatgpt-app-basic my-chatgpt-app
cd my-server
docker build -t my-server:latest .
docker compose up

Now give it a public UI with ngrok: ngrok http 8811

Open the ChatGPT Settings page on ChatGPT.com (not the app), then click on the "Apps and Connectors" section.
Ensure Developer Mode is enabled at the bottom and click the "Create" button at the top right of the settings pane.
Give the connector a name ("UI Test" in this example) and add the ngrok URL. Set the "Authentication" to None

The created connector should look like this:
image

Then ask ChatGPT to call the tool "call the greet tool from the UI test server":
image

After you select a greeting and specify a name within the ChatGPT UI, click "Greet Me" and the tool call will be made.

@kgprs kgprs changed the title Add docker mcp server init command with ChatGPT App UI Add docker mcp server init command to bootstrap a MCP Server with a ChatGPT App UI Oct 28, 2025
Introduces `docker mcp server init <directory>` command to scaffold complete
MCP server projects with ChatGPT App integration.

Command features:
- Creates project structure in specified directory
- --language=go flag (only Go supported currently)
- Validates empty directory and language support
- Customizes all files based on directory name

Generated project includes:
- main.go: MCP server with greet tool and UI resource
- ui.html: Interactive ChatGPT App UI with dropdown (Hi/Hey/Hello) and form
- Dockerfile: Multi-stage build with git for Go dependencies
- compose.yaml: Streaming gateway on port 8811, auth disabled (DOCKER_MCP_IN_CONTAINER=1)
- catalog.yaml: Server registry entry
- go.mod: Module with MCP SDK v1.0.0
- README.md: Complete documentation

ChatGPT App features:
- UI registered as resource at ui://greeter/widget.html with text/html+skybridge MIME type
- Tool metadata: openai/outputTemplate, openai/widgetAccessible, openai/toolInvocation/invoking
- Greet tool with name and greetingType parameters
- Returns structured data for UI consumption
- UI uses window.openai.callTool() API for real tool invocation
- Dropdown, text input, styled button, animated responses

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kgprs kgprs force-pushed the bootstrap_server branch 2 times, most recently from 5ae5716 to 97fc3bc Compare October 29, 2025 21:31
Restructures the `docker mcp server init` command to use file-based templates
instead of embedded constants, making it easier to maintain and extend.

Changes:
- Created two template directories:
  - templates/basic: Simple MCP server without UI
  - templates/chatgpt-app-basic: MCP server with ChatGPT App UI
- Each template has separate .tmpl files for all generated files
- Refactored init.go to use go:embed and text/template
- Added required --template flag to init command
- Template files use {{.ServerName}} for customization

Templates:
- basic: Simple greeter with single name parameter, no UI
- chatgpt-app-basic: Greeter with dropdown (Hi/Hey/Hello), UI resource,
  and full ChatGPT App integration

Usage:
- docker mcp server init --template=basic my-server
- docker mcp server init --template=chatgpt-app-basic my-app

Benefits:
- Easy to add new templates (just create new folder)
- Templates are actual files, easier to edit and test
- Clear separation between basic and ChatGPT App templates
- Better error messages for invalid templates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kgprs kgprs changed the title Add docker mcp server init command to bootstrap a MCP Server with a ChatGPT App UI Add docker mcp server init command to bootstrap an MCP Server with a template Oct 29, 2025
@kgprs kgprs changed the title Add docker mcp server init command to bootstrap an MCP Server with a template Add command to bootstrap an MCP Server with a template Oct 29, 2025
@kgprs kgprs marked this pull request as ready for review October 29, 2025 22:07
@kgprs kgprs requested a review from a team as a code owner October 29, 2025 22:07
@kgprs kgprs force-pushed the bootstrap_server branch 7 times, most recently from ee760ad to 686e671 Compare October 29, 2025 22:44
@kgprs kgprs merged commit 8ba4b44 into main Oct 30, 2025
8 checks passed
@kgprs kgprs deleted the bootstrap_server branch October 30, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants