Skip to content

smallrye/smallrye-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmallRye MCP

"Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools."

This extension define a declarative APIs that enable developers to implement the MCP server features easily.

Example of usage

Add server features (prompts, resources and tools) represented by annotated business methods of beans.

public class ServerFeatures {

    @Inject
    CodeService codeService;

    @Tool(description = "Converts the string value to lower case")
    String toLowerCase(String value) {
        return value.toLowerCase();
    }

    @Prompt(name = "code_assist")
    PromptMessage codeAssist(@PromptArg(name = "lang") String language) {
        return PromptMessage.withUserRole(new TextContent(codeService.assist(language)));
    }

    @Resource(uri = "file:///project/alpha")
    BlobResourceContents alpha(RequestUri uri) throws IOException{
        return BlobResourceContents.create(uri.value(), Files.readAllBytes(Paths.ALPHA));
    }

}

History

This is a copy (with some modifications) from the API defined in https://github.com/quarkiverse/quarkus-mcp-server/tree/main/core/runtime/src/main/java/io/quarkiverse/mcp/server.

About

Standard MCP annotations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages