Skip to content

Commit f5f40ca

Browse files
committed
Refactor README formatting for clarity and consistency
Improved the formatting of the README file by restructuring lines, ensuring proper line breaks, and aligning headings for better readability. Updated tables and added missing environment variable descriptions to enhance documentation completeness.
1 parent 10d57d2 commit f5f40ca

File tree

1 file changed

+56
-33
lines changed

1 file changed

+56
-33
lines changed

README.md

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
# Docker MCP Server
22

3-
This module provides an implementation of a **Model Context Protocol** MCP server for Docker commands, powered by the [`mcp_mediator`](https://github.com/makbn/mcp_mediator) core framework.
4-
The Docker MCP Server utilizes the **automatic server generation** feature of MCP Mediator to expose existing Docker commands as MCP Tools.
5-
Each command is optionally annotated with `@McpTool` along with a minimal description to enhance tool discoverability and usability.
3+
This module provides an implementation of a **Model Context Protocol** MCP server for Docker commands, powered by the [
4+
`mcp_mediator`](https://github.com/makbn/mcp_mediator) core framework.
5+
The Docker MCP Server utilizes the **automatic server generation** feature of MCP Mediator to expose existing Docker
6+
commands as MCP Tools.
7+
Each command is optionally annotated with `@McpTool` along with a minimal description to enhance tool discoverability
8+
and usability.
69

710
👉 See the full list of supported commands [here](#supported-docker-commands-as-mcp-server-tools).
811

912
![Docker MCP Server](./.github/static/docker_mcp_server_inspect.png)
1013

1114

1215
> [!IMPORTANT]
13-
> This is part of `mcp_mediator` project: [https://github.com/makbn/docker_mcp_server](https://github.com/makbn/docker_mcp_server)
14-
> To build or modify, clone the parent repository: `git clone --recurse-submodules https://github.com/makbn/docker_mcp_server.git`
16+
> This is part of `mcp_mediator`
17+
> project: [https://github.com/makbn/docker_mcp_server](https://github.com/makbn/docker_mcp_server)
18+
> To build or modify, clone the parent repository:
19+
`git clone --recurse-submodules https://github.com/makbn/docker_mcp_server.git`
1520

1621
### Usage Examples
1722

@@ -26,8 +31,8 @@ java -jar docker-mcp-server.jar \
2631
--docker-config=/custom/docker/config
2732
```
2833

29-
3034
To run Docker MCP Server with Claude Desktop with `java -jar`:
35+
3136
```yaml
3237
{
3338
"mcpServers": {
@@ -50,40 +55,49 @@ To run Docker MCP Server with Claude Desktop with `java -jar`:
5055
```
5156

5257
Or create the native image (see the steps below) and use the standalone application:
58+
5359
```yaml
5460
{
5561
"mcpServers": {
5662
"my_java_mcp_server": {
5763
"command": "docker-mcp-server-executable",
5864
"args": [
59-
"--docker-host=tcp://localhost:2376" // rest of args
65+
"--docker-host=tcp://localhost:2376" // rest of args
6066
]
6167
}
6268
}
6369
}
6470
```
6571

6672
### How to Build
73+
6774
To build the executable:
75+
6876
```bash
6977
mvn clean compile package
7078
```
71-
This command creates a jar file under `target` folder `mcp-mediator-implementation-docker-[version].jar`. You can stop here and use the jar file and execute it
79+
80+
This command creates a jar file under `target` folder `mcp-mediator-implementation-docker-[version].jar`. You can stop
81+
here and use the jar file and execute it
7282
using `java -jar` command. Or, you can create a standalone executable application using GraalVM native image:
7383

7484
```bash
7585
native-image -jar mcp-mediator-implementation-docker-[version].jar
7686
```
77-
and this command creates an executable file: `'mcp-mediator-implementation-docker-[version]` that can be executed.
7887

88+
and this command creates an executable file: `'mcp-mediator-implementation-docker-[version]` that can be executed.
7989

8090
### Automatically Generate MCP Tools
8191

82-
This project integrates with [`MCP Mediator`](https://github.com/makbn/mcp_mediator) to automatically generate MCP Tools from existing Docker services.
92+
This project integrates with [`MCP Mediator`](https://github.com/makbn/mcp_mediator) to automatically generate MCP Tools
93+
from existing Docker services.
8394

84-
Each method in the Docker service class can optionally be annotated with `@McpTool` to explicitly define the tool’s **name**, **description**, and other metadata.
95+
Each method in the Docker service class can optionally be annotated with `@McpTool` to explicitly define the tool’s *
96+
*name**, **description**, and other metadata.
8597

86-
However, annotation is **not required**—MCP Mediator supports automatic generation for **non-annotated methods** by inferring details from the method, class, and package names. To enable this behavior, set `createForNonAnnotatedMethods` to `true`:
98+
However, annotation is **not required**—MCP Mediator supports automatic generation for **non-annotated methods** by
99+
inferring details from the method, class, and package names. To enable this behavior, set `createForNonAnnotatedMethods`
100+
to `true`:
87101

88102
```java
89103
DefaultMcpMediator mediator = new DefaultMcpMediator(McpMediatorConfigurationBuilder.builder()
@@ -92,30 +106,36 @@ DefaultMcpMediator mediator = new DefaultMcpMediator(McpMediatorConfigurationBui
92106
.serverVersion(serverVersion)
93107
.build());
94108

95-
mediator.registerHandler(McpServiceFactory.create(dockerClientService)
96-
.createForNonAnnotatedMethods(true)); // Enables support for non-annotated methods
109+
mediator.
110+
111+
registerHandler(McpServiceFactory.create(dockerClientService)
112+
.
113+
114+
createForNonAnnotatedMethods(true)); // Enables support for non-annotated methods
97115

98116
```
99117

100118
Check `io.github.makbn.mcp.mediator.docker.server.DockerMcpServer` for the full Mcp Mediator configuration.
101119

120+
### Supported CLI Options
102121

122+
| Option | Description | Default |
123+
|---------------------|---------------------------------------------------------------------|-------------------------------|
124+
| `--docker-host` | Docker daemon host URI | `unix:///var/run/docker.sock` |
125+
| `--tls-verify` | Enable TLS verification (used with `--cert-path`) | `false` |
126+
| `--cert-path` | Path to Docker TLS client certificates (required if TLS is enabled) | _none_ |
127+
| `--docker-config` | Custom Docker config directory | `~/.docker` |
128+
| `--server-name` | Server name for the MCP server | `docker_mcp_server` |
129+
| `--server-version` | Server version label | `1.0.0.0` |
130+
| `--max-connections` | Maximum number of connections to Docker daemon | `100` |
131+
| `--help` | Show usage and available options | _n/a_ |
103132

104-
105-
### Supported CLI Options
133+
Environment variables:
106134

107-
| Option | Description | Default |
108-
|--------------------|-------------------------------------------------------|-------------------------------|
109-
| `--docker-host` | Docker daemon host URI | `unix:///var/run/docker.sock` |
110-
| `--tls-verify` | Enable TLS verification (used with `--cert-path`) | `false` |
111-
| `--cert-path` | Path to Docker TLS client certificates (required if TLS is enabled) | _none_ |
112-
| `--docker-config` | Custom Docker config directory | `~/.docker` |
113-
| `--server-name` | Server name for the MCP server | `docker_mcp_server` |
114-
| `--server-version` | Server version label | `1.0.0.0` |
115-
| `--max-connections`| Maximum number of connections to Docker daemon | `100` |
116-
| `--log-level` | Logging level (`TRACE`, `DEBUG`, `INFO`, etc.) | `DEBUG` |
117-
| `--log-file` | Path to log output file | `logs/example.log` |
118-
| `--help` | Show usage and available options | _n/a_ |
135+
| Option | Description | Default |
136+
|-----------------------|------------------------------------------------|------------------------------|
137+
| `DOCKER_MCP_LOG_LEVEL` | Logging level (`TRACE`, `DEBUG`, `INFO`, etc.) | `DEBUG` |
138+
| `DOCKER_MCP_LOG_FILE` | Path to log output file | `logs/docker_mcp_server.log` |
119139

120140

121141
### Supported Docker Commands as MCP Server Tools
@@ -177,17 +197,19 @@ Check `io.github.makbn.mcp.mediator.docker.server.DockerMcpServer` for the full
177197

178198
Work in progress, more to be added.
179199

180-
181200
### DockerClientService Function Coverage
182-
Check the [DockerClientService](./src/main/java/io/github/makbn/mcp/mediator/docker/internal/DockerClientService.java) class for the full list of available and planned tools (to be implemented)
183201

184-
> [!IMPORTANT]
185-
> Almost all the MCP Tools' descriptions and names are generated automatically using AI agent!
202+
Check the [DockerClientService](./src/main/java/io/github/makbn/mcp/mediator/docker/internal/DockerClientService.java)
203+
class for the full list of available and planned tools (to be implemented)
186204

205+
> [!IMPORTANT]
206+
> Almost all the MCP Tools' descriptions and names are generated automatically using AI agent!
187207
188208
### 🧩 Repository Structure and Git Subtree Setup
189209

190-
This project is a **Git subtree module** of the parent repository [`makbn/mcp_mediator`](https://github.com/makbn/mcp_mediator). It is kept in its own repository to support independent versioning, CI, and release processes, while remaining integrated into the main `mcp_mediator` mono-repo.
210+
This project is a **Git subtree module** of the parent repository [
211+
`makbn/mcp_mediator`](https://github.com/makbn/mcp_mediator). It is kept in its own repository to support independent
212+
versioning, CI, and release processes, while remaining integrated into the main `mcp_mediator` mono-repo.
191213

192214
### 🔀 Cloning Structure
193215

@@ -196,6 +218,7 @@ If you're working in the context of the full `mcp_mediator` system:
196218
```bash
197219
`git clone --recurse-submodules https://github.com/makbn/docker_mcp_server.git`
198220
```
221+
199222
### Contributing
200223

201224
Contributions are welcome! Please feel free to submit a Pull Request. Read this first!

0 commit comments

Comments
 (0)