Skip to content
Merged
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `./examples/infobip-sms-mock-mcp` project that demonstrates the recently introduced mock tool mode.

### Changed

- Upgraded framework version in the open-meteo-mcp example to the latest release.

## 0.1.3

### Added
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Some of the core features include:
- OpenAPI specification allows advanced features in request schema definitions, such as discriminators for polymorphic
models. This is not allowed in pure JSON schema used by MCP, so the framework has a transformation step in which
discriminators are resolved and embedded in a way compatible with JSON schema.
- Mock mode in which resulting MCP server s
- Mock mode in which MCP server returns examples from the OpenAPI specification instead of making HTTP API calls

> [!IMPORTANT]
> The OpenAPI MCP framework allows you to expose any HTTP API documented with OpenAPI to LLM agents. Since LLMs will
Expand Down Expand Up @@ -75,14 +75,14 @@ You can install it in your Java project with maven:
<dependency>
<groupId>com.infobip.openapi.mcp</groupId>
<artifactId>infobip-openapi-mcp-spring-boot-starter</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
</dependency>
```

or gradle:

```groovy
implementation("com.infobip.openapi.mcp:infobip-openapi-mcp-spring-boot-starter:0.1.2")
implementation("com.infobip.openapi.mcp:infobip-openapi-mcp-spring-boot-starter:0.1.3")
```

## Usage
Expand Down Expand Up @@ -255,7 +255,7 @@ type from the API endpoint that corresponds to the tool being called. In case ex
API endpoint an error MCP result is returned. This feature is disabled by default, and can be enabled by setting the
externalized configuration property `infobip.openapi.mcp.tools.mock: true`.

> [!NODE]
> [!NOTE]
> Even with mock mode enabled, security features still work and will delegate authentication checks to the server
> defined by the `infobip.openapi.mcp.security.auth.auth-url` property. This allows MCP client implementors to test
> authentication configuration on their end, including OAuth config.
Expand Down
226 changes: 226 additions & 0 deletions examples/infobip-sms-mock-mcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,intellij+all,visualstudiocode,java,maven
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,intellij+all,visualstudiocode,java,maven

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

.idea/*

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,intellij+all,visualstudiocode,java,maven

# Generated by GitHub workflows while preparing a release:
./release_notes.md
18 changes: 18 additions & 0 deletions examples/infobip-sms-mock-mcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build stage
FROM maven:3.9-eclipse-temurin-25 AS build

WORKDIR /build

COPY pom.xml .
RUN mvn dependency:go-offline

COPY src ./src
RUN mvn clean package

# Runtime stage
FROM eclipse-temurin:25-jre-alpine
WORKDIR /opt/infobip-sms-mock-mcp

# Name of the jar file is fixed in the pom.xml
COPY --from=build /build/target/mcp-server.jar /opt/infobip-sms-mock-mcp/mcp-server.jar
ENTRYPOINT ["java", "-XX:UseSVE=0", "-jar", "mcp-server.jar"]
77 changes: 77 additions & 0 deletions examples/infobip-sms-mock-mcp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Infobip SMS Mock MCP Server

En example project that exposes a mock of Infobip's official SMS MCP server using the `infobip-openapi-mcp-spring-boot-starter` framework. Project exposes MCP server over [Streamable HTTP transport protocol][1]. The mock MCP server can be used in testing MCP clients to see how they behave without connecting to production HTTP APIs. When AI agent makes tools calls to MCP server running in the mock mode it will not make HTTP requests to the underlying API. Instead, MCP server will return [response examples][2] from the provided OpenAPI specification. This allows for more predictable tests that do not depend on 3rd party servers, nor require production account setup. You can read more about the mock mode in [README.md][3].

## Build

Project can be built and packaged locally using Docker.

Run the bash command from the example project's root directory:

```shell
docker build -t infobip-sms-mock-mcp .
```

You can verify that build passed by listing available docker images. Output should contain the new `infobip-sms-mock-mcp` image, for example:

```shell
$ docker image ls
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
infobip-sms-mock-mcp:latest 642d196e9572 370MB 107MB
```

## Run

Run the mock MCP server in interactive mode on `localhost` on port `8080` using Docker:

```shell
docker run --rm -ti -p 8080:8080 infobip-sms-mock-mcp:latest
```

You should see the standard Spring application startup logs in the terminal. Successful run will finish with logs resembling these:

```
2026-01-07T10:33:19.774Z INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http)
2026-01-07T10:33:19.780Z INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2026-01-07T10:33:19.781Z INFO 1 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.48]
2026-01-07T10:33:19.792Z INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2026-01-07T10:33:19.792Z INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 439 ms
2026-01-07T10:33:20.004Z INFO 1 --- [ main] c.i.openapi.mcp.openapi.OpenApiRegistry : Loading OpenAPI from https://api.infobip.com/platform/1/openapi/mcp/sms.
2026-01-07T10:33:20.586Z INFO 1 --- [ main] c.i.o.m.o.filter.OpenApiFilterChain : Applying OpenAPI filter: DiscriminatorFlattener.
2026-01-07T10:33:20.587Z INFO 1 --- [ main] c.i.o.m.o.filter.OpenApiFilterChain : Applying OpenAPI filter: PatternPropertyRemover.
2026-01-07T10:33:20.733Z INFO 1 --- [ main] c.i.openapi.mcp.openapi.OpenApiRegistry : Successfully loaded OpenAPI from https://api.infobip.com/platform/1/openapi/mcp/sms.
2026-01-07T10:33:20.759Z WARN 1 --- [ main] s.m.p.r.SyncStatelessMcpResourceProvider : No resource methods found in the provided resource objects: []
2026-01-07T10:33:20.759Z WARN 1 --- [ main] s.m.p.r.SyncStatelessMcpResourceProvider : No resource methods found in the provided resource objects: []
2026-01-07T10:33:20.760Z WARN 1 --- [ main] o.s.m.p.p.SyncStatelessMcpPromptProvider : No prompt methods found in the provided prompt objects: []
2026-01-07T10:33:20.761Z WARN 1 --- [ main] s.m.p.c.SyncStatelessMcpCompleteProvider : No complete methods found in the provided complete objects: []
2026-01-07T10:33:20.762Z WARN 1 --- [ main] o.s.m.p.t.SyncStatelessMcpToolProvider : No tool methods found in the provided tool objects: []
2026-01-07T10:33:20.766Z INFO 1 --- [ main] .c.a.McpServerStatelessAutoConfiguration : Registered tools: 8
2026-01-07T10:33:20.766Z INFO 1 --- [ main] .c.a.McpServerStatelessAutoConfiguration : Enable completions capabilities
2026-01-07T10:33:20.819Z INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path '/'
2026-01-07T10:33:20.825Z INFO 1 --- [ main] com.infobip.mcp.example.Application : Started Application in 1.667 seconds (process running for 1.832)
```

Note the `Tomcat started on port 8080` and `Registered tools: 8` parts. This means MCP server is accessible on port `8080` and that it loaded 8 tools from the OpenAPI specification that we provided.

> [!NOTE]
> This example is using the latest version of Infobip's SMS OpenAPI specification. With time new API endpoints might get introduced, and existing endpoints might get deprecated and removed. Over time the number of tools exposed by this mock MCP server will change accordingly.
>
> In production, you may want to lock the version of OpenAPI specification, especially when targeting a 3rd party API. See the [open-meteo-mcp](../open-meteo-mcp) example to learn how. With the mock MCP server, especially if it is used in testing, you may want to always pull the latest spec version, so that your tests always run against the currently deployed API specification. Without breaking changes on the API side it should not matter, but this approach will let you catch any issues in your tests.

## Use

You can try it out by connecting to it with an MCP capable AI agent that supports Streamable HTTP transport, such as [Cursor editor][4]. With Cursor app installed on your machine click this link to install your mock MCP server running on localhost: [https://cursor.com/en-US/install-mcp?name=infobip-sms-mock&config=eyJ1cmwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvbWNwIn0%3D](https://cursor.com/en-US/install-mcp?name=infobip-sms-mock&config=eyJ1cmwiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvbWNwIn0%3D)

Congratulations, you can now ask agent inside Cursor to send SMS text messages to the mock server!

https://github.com/user-attachments/assets/25c6775a-73ea-4bef-8387-595c8e079cfb

---

[1]: https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http "Streamable HTTP transport in MCP documentation"

[2]: https://swagger.io/docs/specification/v3_0/adding-examples/ "Adding Examples guide in OpenAPI docs"

[3]: https://github.com/infobip/infobip-openapi-mcp/blob/main/README.md#mock-mode "Mock mode section of project's README.md"

[4]: https://cursor.com/home
Loading