cobolMCP
This is a hello world MCP server written in GNU COBOL because, well, why not?
Open source Open in the app JSON README (API)
About
This is a hello world MCP server written in GNU COBOL because, well, why not?
Details
- Kind
- Plugins
- Topic
- No topic detected
- Publisher
- idjohnson
- Origin
- gemini
- Category
- ferramentas
- Version
- 1.0.0
- Stars
- 1
- Last push
- 2026-01-08T20:37:49Z
- Repository state
- ativo
- Language
- COBOL
- Added
- 2026-08-30 14:13:39
- Updated
- 2026-08-30 14:13:39
- Origin id
idjohnson/cobolmcp
README
# COBOL MCP Server
A basic "Hello World" Model Context Protocol (MCP) server written in COBOL (GnuCOBOL).
## Overview
This server implements a subset of the MCP specification over HTTP (JSON-RPC 2.0). It provides a single tool: `hello_world`.
## Requirements
- Docker
## Building
To build the Docker image:
```bash
docker build -t cobol-mcp .
```
## Running
To run the server on port 8090:
```bash
docker run -p 8090:8090 cobol-mcp
```
## Testing
There is a provided `test.sh` script that launches the container and runs a test suite against it.
```bash
./test.sh
```
### Manual Testing
You can send a POST request with curl:
```bash
curl -X POST http://localhost:8090/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "hello_world",
"arguments": {
"name": "Developer"
}
},
"id": 1
}'
```
## Implementation Details
- **Language**: COBOL (GnuCOBOL)
- **Transport**: HTTP (TCP Sockets)
- **Files**:
- `server.cbl`: Main TCP server loop.
- `mcp-handler.cbl`: Request parser and response generator.
- `socket-defs.cpy`, `http-structs.cpy`: Data structures.
## Http Streamable Docker
Run it in docker, e.g.
```
$ docker run --name cobol-mcp-server -p 8090:8090 idjohnson/cobolmcp:latest
```
### Copilot settings
You can use the MCP server add UI to add an HTTP server for http://localhost:8090 or add this block in the mcp.json file:
```
"cobolMCP": {
"url": "http://localhost:8090/mcp",
"type": "http"
}
```
### Gemini CLI settings
Using in either `~/.gemini/settings.json` or a local `.gemini/settings.json`, access the httpStreamable server:
```json
"mcpServers": {
"cobolMCP": {
"httpUrl": "http://localhost:8090",
"timeout": 5000
}
},
```
# Installing into Kubernetes
There is a local chart in /charts you can use.
For instance, I set this up with my local Kubernetes and a proper TLS ingress using the following values file:
```yaml
# Default values for cobolmcp.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: idjohnson/cobolmcp
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"
ingress:
enabled: true
className: "nginx"
annotations:
cert-manager.io/cluster-issuer: gcpleprod2
ingress.kubernetes.io/proxy-body-size: "0"
ingress.kubernetes.io/ssl-redirect: "true"
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
hosts:
- host: cobolmcp.steeped.icu
paths:
- path: /
pathType: ImplementationSpecific
tls:
- secretName: cobolmcpgcp-tls
hosts:
- cobolmcp.steeped.icu
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
```
Then installed:
```
$ helm upgrade --install cobolmcp -f ./values.yaml ./charts/cobolmcp
Release "cobolmcp" has been upgraded. Happy Helming!
NAME: cobolmcp
LAST DEPLOYED: Thu Jan 8 14:15:41 2026
NAMESPACE: default
STATUS: deployed
REVISION: 3
NOTES:
1. Get the application URL by running these commands:
https://cobolmcp.steeped.icu/
```
If you opt not to use a public ingress, it will create a ClusterIP service you could use with port-forward
```
$ kubectl get svc | grep cobol
cobolmcp ClusterIP 10.43.183.219 <none> 8090/TCP 18m
$ kubectl port-forward svc/cobolmcp 8099:8090
Forwarding from 127.0.0.1:8099 -> 8090
Forwarding from [::1]:8099 -> 8090
```
## License
MIT