Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS := $(filter-out src/dbtools-mcp-server src/mysql-mcp-server src/oci-pricing-mcp-server src/oracle-db-doc-mcp-server,$(wildcard src/*))
SUBDIRS ?= $(filter-out src/dbtools-mcp-server src/mysql-mcp-server src/oci-pricing-mcp-server src/oracle-db-doc-mcp-server,$(wildcard src/*))

.PHONY: test format

Expand Down Expand Up @@ -46,13 +46,13 @@ lint:
uv tool run --from 'tox==4.30.2' tox -e lint

test:
uv run coverage erase
@for dir in $(SUBDIRS); do \
if [ -f $$dir/pyproject.toml ]; then \
echo "Testing $$dir"; \
cd $$dir && \
COVERAGE_FILE=../../.coverage.$$(_basename=$$(basename $$dir); echo $$_basename) \
uv run pytest --cov=. --cov-branch --cov-append --cov-report=html --cov-report=term-missing && \
cd ../..; \
( cd $$dir && \
COVERAGE_FILE=../../.coverage.$$(basename $$dir) \
uv run pytest --cov=. --cov-branch --cov-append --cov-report=html --cov-report=term-missing ) || exit 1; \
fi \
done
$(MAKE) combine-coverage
Expand All @@ -67,3 +67,17 @@ format:

e2e-tests: build install
behave tests/e2e/features && cd ..

# Create docker images for the specified MCP servers
dockerize:
@for dir in $(SUBDIRS); do \
if [[ -f $$dir/Dockerfile && (-f $$dir/pyproject.toml) ]]; then \
name=$$(uv run tomlq -r '.project.name' $$dir/pyproject.toml); \
version=$$(uv run tomlq -r '.project.version' $$dir/pyproject.toml); \
echo "Building Docker image for $$dir"; \
cd $$dir && \
docker build -t $$name:$$version . && \
docker tag $$name:$$version $$name:latest && \
echo "Docker image $$name:$$version (tagged with $$name:latest) built successfully" && cd ../..; \
fi \
done
97 changes: 94 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Below is an example MCP client configuration for a typical python server
*(For Node.js/Java/other servers, follow respective instructions in that server’s README)*

For macOS/Linux:
```
```json
{
"mcpServers": {
"oracle-oci-api-mcp-server": {
Expand Down Expand Up @@ -75,6 +75,29 @@ transport value while others (like Cline) expect `streamableHttp`.
}
```

## Running with Docker

Some MCP servers in this repository support running via Docker.

### Building the Docker Image

You can build the docker image using the following command. The command shows building the docker image for the oci-api-mcp-server.

```sh
SUBDIRS=src/oci-api-mcp-server make dockerize
```
The above command builds the Docker image tagged as `oracle.oci-api-mcp-server:latest`.

### MCP Client Configuration

For examples of configuring MCP clients to run the server using Docker, see the client-specific sections below. Configurations typically involve using `docker run` as the command, with appropriate flags and volume mounts for credentials if needed (e.g., mounting `~/.oci` for OCI servers).

Alternatively, if you want to use HTTP transport using the docker container, then start the MCP docker using the following command and configure your client as mentioned in Quickstart section above.
```bash
docker run -v "/path/to/your/.oci:/app/.oci" -e ORACLE_MCP_HOST=0.0.0.0 -e ORACLE_MCP_PORT=8888 oracle.oci-api-mcp-server:latest
```
⚠️ **NOTE**: Ensure that the _key_file_ field in /path/to/your/.oci/config uses the ~ character so that the path resolves both inside and outside the container; for example: `key_file=~/.oci/oci_api_key.pem`.

## Authentication

For OCI MCP servers, you'll need to install and authenticate using the OCI CLI.
Expand Down Expand Up @@ -138,6 +161,32 @@ For macOS/Linux:
}
```

Alternatively, to run using Docker (example for oracle.oci-api-mcp-server):

```json
{
"mcpServers": {
"oracle-oci-api-mcp-server": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "/path/to/your/.oci:/app/.oci", "oracle.oci-api-mcp-server:latest"],
"env": {
"FASTMCP_LOG_LEVEL": "INFO"
}
}
}
}
```

Replace `"/path/to/your/.oci"` with the actual path to your OCI configuration directory.

⚠️ **NOTE**: Ensure that the _key_file_ field in /path/to/your/.oci/config uses the ~ character so that the path resolves both inside and outside the container; for example: `key_file=~/.oci/oci_api_key.pem`.

For servers not requiring OCI credentials, omit the `-v` volume mount.

For Windows - **TODO**

7. Once installed, you should see a list of your **MCP Servers** under the **Installed** tab. They will have a green toggle that shows that they are enabled.
Expand Down Expand Up @@ -179,6 +228,27 @@ For macOS/Linux:
}
```

Alternatively, to run using Docker (example for oracle-oci-api-mcp-server):

```json
{
"mcpServers": {
"oracle-oci-api-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "/path/to/your/.oci:/app/.oci", "oracle.oci-api-mcp-server:latest"],
"env": {
"FASTMCP_LOG_LEVEL": "INFO"
}
}
}
}
```

Replace `"/path/to/your/.oci"` with the actual path to your OCI configuration directory.

For servers not requiring OCI credentials, omit the `-v` volume mount.

`<profile_name>` is the profile that you set up during the [authentication](#authentication) steps.

For Windows - **TODO**
Expand Down Expand Up @@ -230,6 +300,27 @@ For macOS/Linux:
}
```

Alternatively, to run using Docker (example for oracle-oci-api-mcp-server):

```json
{
"mcpServers": {
"oracle-oci-api-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "/path/to/your/.oci:/app/.oci", "oracle.oci-api-mcp-server:latest"],
"env": {
"FASTMCP_LOG_LEVEL": "INFO"
}
}
}
}
```

Replace `"/path/to/your/.oci"` with the actual path to your OCI configuration directory.

For servers not requiring OCI credentials, omit the `-v` volume mount.

`<profile_name>` is the profile that you set up during the [authentication](#authentication) steps.

For Windows - **TODO**
Expand Down Expand Up @@ -265,7 +356,7 @@ Below is an example MCP client configuration for a typical python server using t
*(For Node.js/Java/other servers, follow respective instructions in that server’s README)*

For macOS/Linux:
```
```json
{
"mcpServers": {
"oracle-oci-api-mcp-server": {
Expand Down Expand Up @@ -350,7 +441,7 @@ the [documentation](https://modelcontextprotocol.io/docs/tools/inspector).
The Inspector runs directly through npx without requiring installation. For instance, to inspect your locally developed
server, you can run:

```
```sh
npx @modelcontextprotocol/inspector \
uv \
--directory <absolute path to your server code> \
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pydantic
fastmcp
oci
oci-cli
10 changes: 10 additions & 0 deletions src/oci-api-mcp-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.venv
venv
bldvenv

.pytest_cache
dist
**/__pycache__

htmlcov
.coverage
30 changes: 30 additions & 0 deletions src/oci-api-mcp-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2025, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v1.0 as shown at
# https://oss.oracle.com/licenses/upl.

FROM ghcr.io/oracle/oraclelinux@sha256:1950389c3dd619841813520b4e69d7f3112c4c10f713fcb90680703d184c33ad

# Install python 3.13
RUN microdnf install epel-release && \
microdnf install python3.13 python3.13-pip \
&& rm -rf /var/cache/dnf/* \
&& useradd -m -d /app oracle

# Copy the MCP server to the docker container
WORKDIR /app
COPY --chown=oracle:oracle . /app

# Install dependencies
RUN pip3.13 install --no-cache-dir uv && \
uv --no-cache sync --locked --all-extras

# Change user
USER oracle

# HTTP support
ENV ORACLE_MCP_HOST=""
ENV ORACLE_MCP_PORT=""

# Start the MCP server
ENTRYPOINT ["uv", "run"]
CMD ["oracle.oci-api-mcp-server"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"""

__project__ = "oracle.oci-api-mcp-server"
__version__ = "1.1.0"
__version__ = "1.1.1"
4 changes: 2 additions & 2 deletions src/oci-api-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "oracle.oci-api-mcp-server"
version = "1.1.0"
version = "1.1.1"
description = "OCI CLI MCP server"
readme = "README.md"
requires-python = ">=3.13"
Expand All @@ -11,7 +11,7 @@ authors = [
]
dependencies = [
"fastmcp==2.13.0",
"oci==2.160.0",
"oci-cli==3.71.1"
]

classifiers = [
Expand Down
Loading