MCP ExplorerExplorer

Mcp Micronaut Poc

@sataion a year ago
6 Apache-2.0
FreeCommunity
AI Systems
# Proof of Concept (PoC) for Micronaut Model Context Protocol Integration

Overview

What is Mcp Micronaut Poc

mcp-micronaut-poc is a Proof of Concept (PoC) project that demonstrates the integration of the Model Context Protocol (MCP) with the Micronaut framework, allowing Micronaut beans to be exposed as MCP tools for AI models or other MCP clients.

Use cases

Use cases include creating reusable tools for AI models, integrating Micronaut applications with other services via MCP, and developing applications that require dynamic tool invocation.

How to use

To use mcp-micronaut-poc, create a Micronaut bean with methods annotated with @Tool. The tool will be automatically registered with the MCP server upon application startup, and clients can call the tool using the MCP protocol over standard input/output.

Key features

Key features include the ability to expose Micronaut beans as MCP tools, automatic registration of tools with the MCP server, and support for standard input/output communication.

Where to use

mcp-micronaut-poc can be used in fields that require integration of AI models with application services, particularly in scenarios where tools need to be exposed for remote invocation.

Content

MCPNaut Cli Example

PoC of MCP (Model Context Protocol) integration into Micronaut framework.

Build Status

Overview

This project demonstrates how to integrate the Model Context Protocol (MCP) with the Micronaut framework. It provides a way to expose Micronaut beans as MCP tools that can be called by AI models or other MCP clients.

Installation

Prerequisites

  • JDK 17 or higher

Building the Project

./gradlew build

Running the Application

./gradlew run

Usage

Creating an MCP Tool

  1. Create a Micronaut bean with methods annotated with @Tool:
@Singleton
class MyTool {
    @Tool(
        name = "myTool",
        description = "A tool that does something useful"
    )
    fun doSomething(
        @ToolArg(description = "First parameter") param1: String,
        @ToolArg(description = "Second parameter") param2: Int
    ): String {
        return "Result: $param1 $param2"
    }
}
  1. The tool will be automatically registered with the MCP server when the application starts.

  2. Clients can call the tool using the MCP protocol over standard input/output.

Project Structure

  • MicronautMcpCliCommand.kt - Main command class that sets up the MCP server
  • ServerWrapper.kt - Wrapper for the MCP server
  • ToolBuilder.kt - Processes methods annotated with @Tool and registers them as MCP tools
  • ToolAnnotations.kt - Defines the @Tool and @ToolArg annotations
  • TypeConverter.kt - Converts JDK types to MCP types
  • ArgumentConverter.kt - Converts MCP arguments to JDK types
  • FooTool.kt - Example tool implementation

Limitations

  • Not a library now, just example App
  • CLI (StdInOut) communication only
  • Tools only (no Prompts…)
  • Only int, boolean, number and strings and arrays (one or multidimensional) as parameters
  • Only one String on output, no pictures, music
  • no configuration of the server
  • Temporary (?) package

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Apache License 2.0.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers