Skip to contents

MCP Core Functions

Core functions for creating and managing MCP server objects

new_server() new_mcp()
Create a new MCP object
add_capability()
Add a capability to an MCP object
register_mcpr_tools()
Register MCPR tools with an ellmer chat

Capability Creation

Functions for creating different types of capabilities

new_tool()
Create a new tool
new_resource()
Create a new resource
new_prompt()
Create a new prompt

Schema and Properties

Functions for defining input schemas and properties

schema()
Create a new input schema
properties()
Create a new properties list
property_string()
Create a string property definition
property_number()
Create a number property definition
property_boolean()
Create a boolean property definition
property_array()
Create an array property definition
property_object()
Create an object property definition
property_enum()
Create an enum property with predefined values
new_property()
Create a new property

Server Functions

Functions for serving MCP implementations

serve_io()
Serve an MCP server using stdin/stdout
serve_http()
Serve an MCP server over HTTP using ambiorix
get_name()
Get the name of a client

Client Functions

Functions for connecting to and interacting with MCP servers

new_client_io() new_client_http()
Create a new mcp IO
initialize()
Initialize the server with protocol information
tools_list()
List all available tools
tools_call()
Call a tool with the given parameters
prompts_list()
List all available prompts
prompts_get()
Get a prompt with the given parameters
resources_list()
List all available resources
resources_read()
Read a resource with the given parameters
read()
Read a JSON-RPC response from a client provider
write()
Write a JSON-RPC request to a client provider

Response Functions

Functions for creating various response types

Roxygen2 Extension

Functions for extending roxygen2 with MCP server generation

mcp_roclet()
MCP Roclet for Generating MCP Servers
roxy_tag_parse(<roxy_tag_mcp>)
Parse @mcp tag
roxy_tag_parse(<roxy_tag_type>)
Parse @type tag
roclet_process(<roclet_mcp>)
Process blocks for MCP roclet
roxy_tag_rd(<roxy_tag_mcp>)
Roxygen2 tag for @mcp This function is called by Roxygen2 to generate documentation for the @mcp tag
roxy_tag_rd(<roxy_tag_type>)
Roxygen2 tag handler for @type This function is called by Roxygen2 to generate documentation for the @type
roclet_output(<roclet_mcp>)
Generate MCP server output

Ellmer Integration

Functions for integrating with the Ellmer package

register_mcpr_tools()
Register MCPR tools with an ellmer chat
ellmer_to_mcpr_tool()
Convert ellmer tools to mcpr tools