-
Notifications
You must be signed in to change notification settings - Fork 0
Jantolis examples infobip sms mock #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
28e78d1
Add infobip-sms-mock-mcp example
Antolius f51ebdb
Upload screen recording of installing & using mock MCP server in Cursor
Antolius f8965e8
Update usage examples in readme to latest release
Antolius c1d2e4d
Update the Cursor recording
Antolius e73cd33
Update mock example's readme
Antolius 21945da
Fix readmes
Antolius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # 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. | ||
|
|
||
| ## 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][2]. 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/77e7972d-5692-492a-b2e5-72eae40e6443 | ||
|
|
||
| --- | ||
|
|
||
| [1]: https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#streamable-http "Streamable HTTP transport in MCP documentation" | ||
|
|
||
| [2]: https://cursor.com/home | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <groupId>com.infobip.mcp.example</groupId> | ||
| <artifactId>infobip-sms-mock-mcp</artifactId> | ||
| <version>1.0-SNAPSHOT</version> | ||
|
|
||
| <properties> | ||
| <maven.compiler.source>25</maven.compiler.source> | ||
| <maven.compiler.target>25</maven.compiler.target> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <!-- This is the only dependency that we need. !--> | ||
| <groupId>com.infobip.openapi.mcp</groupId> | ||
| <artifactId>infobip-openapi-mcp-spring-boot-starter</artifactId> | ||
| <version>0.1.3</version> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <!-- Static JAR file name, which is referenced in the Dockerfile --> | ||
| <finalName>mcp-server</finalName> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-maven-plugin</artifactId> | ||
| <configuration> | ||
| <mainClass>com.infobip.mcp.example.Application</mainClass> | ||
| <layout>JAR</layout> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>repackage</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| </project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.