It is generated with Stainless.
You can run the MCP Server directly via npx
:
export MESSARI_SDK_API_KEY="My API Key"
npx -y @messari/sdk-ts-mcp@latest
There is a partial list of existing clients at modelcontextprotocol.io. If you already have a client, consult their documentation to install the MCP server.
For clients with a configuration JSON, it might look something like this:
{
"mcpServers": {
"messari_sdk_ts_api": {
"command": "npx",
"args": ["-y", "@messari/sdk-ts-mcp", "--client=claude", "--tools=dynamic"],
"env": {
"MESSARI_SDK_API_KEY": "My API Key"
}
}
}
}
There are two ways to expose endpoints as tools in the MCP server:
- Exposing one tool per endpoint, and filtering as necessary
- Exposing a set of tools to dynamically discover and invoke endpoints from the API
You can run the package on the command line to discover and filter the set of tools that are exposed by the MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's context window.
You can filter by multiple aspects:
-
--tool
includes a specific tool by name -
--resource
includes all tools under a specific resource, and can have wildcards, e.g.my.resource*
-
--operation
includes just read (get/list) or just write operations
If you specify --tools=dynamic
to the MCP server, instead of exposing one tool per endpoint in the API, it will
expose the following tools:
-
list_api_endpoints
- Discovers available endpoints, with optional filtering by search query -
get_api_endpoint_schema
- Gets detailed schema information for a specific endpoint -
invoke_api_endpoint
- Executes any endpoint with the appropriate parameters
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore, you can opt-in to explicit tools, the dynamic tools, or both.
See more information with --help
.
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. --no-tool
).
Use --list
to see the list of available tools, or see below.
Different clients have varying abilities to handle arbitrary tools and schemas.
You can specify the client you are using with the --client
argument, and the MCP server will automatically
serve tools and schemas that are more compatible with that client.
-
--client=<type>
: Set all capabilities based on a known MCP client- Valid values:
openai-agents
,claude
,claude-code
,cursor
- Example:
--client=cursor
- Valid values:
Additionally, if you have a client not on the above list, or the client has gotten better over time, you can manually enable or disable certain capabilities:
-
--capability=<name>
: Specify individual client capabilities- Available capabilities:
-
top-level-unions
: Enable support for top-level unions in tool schemas -
valid-json
: Enable JSON string parsing for arguments -
refs
: Enable support for $ref pointers in schemas -
unions
: Enable support for union types (anyOf) in schemas -
formats
: Enable support for format validations in schemas (e.g. date-time, email) -
tool-name-length=N
: Set maximum tool name length to N characters
-
- Example:
--capability=top-level-unions --capability=tool-name-length=40
- Example:
--capability=top-level-unions,tool-name-length=40
- Available capabilities:
- Filter for read operations on cards:
--resource=cards --operation=read
- Exclude specific tools while including others:
--resource=cards --no-tool=create_cards
- Configure for Cursor client with custom max tool name length:
--client=cursor --capability=tool-name-length=40
- Complex filtering with multiple criteria:
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
// Import the server, generated endpoints, or the init function
import { server, endpoints, init } from "@messari/sdk-ts-mcp/server";
// import a specific tool
import generateCompletionOpenAIAIChat from "@messari/sdk-ts-mcp/tools/ai/openai/chat/generate-completion-openai-ai-chat";
// initialize the server and all endpoints
init({ server, endpoints });
// manually start server
const transport = new StdioServerTransport();
await server.connect(transport);
// or initialize your own server with specific tools
const myServer = new McpServer(...);
// define your own endpoint
const myCustomEndpoint = {
tool: {
name: 'my_custom_tool',
description: 'My custom tool',
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
},
handler: async (client: client, args: any) => {
return { myResponse: 'Hello world!' };
})
};
// initialize the server with your custom endpoints
init({ server: myServer, endpoints: [generateCompletionOpenAIAIChat, myCustomEndpoint] });
The following tools are available in this MCP server.
-
generate_completion_openai_ai_chat
(write
): Processes a conversation and returns an AI-generated response in OpenAI-compatible format. Consumes 5 credits per request.
-
generate_signal_v1_ai_agent
(write
): Provides crypto market and social signals by processing user queries through an LLM that accesses Messari's research and data. Consumes 1 credit per request.
-
extract_entities_v1_ai_classification
(write
): Extract entities from a user message by calling an LLM and doing searches in the internal database. Consumes 1 credit per request.
-
create_completion_v2_ai_chat
(write
): Processes a conversation and returns an AI-generated response with Messari's standard format. Consumes 5 credits per request.
-
list_acquisition_deals_funding_v1
(read
): Lookup M&A Deals given a set of filters. -
list_organizations_funding_v1
(read
): Lookup Organizations given a set of filters. -
list_projects_funding_v1
(read
): Lookup Projects given a set of filters.
-
list_v1_funding_funds
(read
): Lookup Funds given a set of filters. -
list_managers_v1_funding_funds
(read
): Lookup the Managers of a set of Funds defined by the filters. Filters are applied to the Funds, and then their Managers are returned.
-
list_v1_funding_rounds
(read
): Lookup Funding Rounds given a set of filters. -
list_investors_v1_funding_rounds
(read
): Lookup Investors that participated in a set of Funding Rounds given a set of filters. Filters are applied to the Funding Rounds, and then their Investors are returned.
-
retrieve_v1_metrics_exchanges
(read
): Retrieve a specific exchange -
list_v1_metrics_exchanges
(read
): Retrieve a list of exchanges
-
list_exchanges_v1_metrics_metrics
(read
): Get metric catalog of datasets for exchanges.
-
retrieve_metrics_exchanges_v1_metrics_time_series
(read
): Retrieve a specific exchange's timeseries data -
retrieve_with_granularity_metrics_exchanges_v1_metrics_time_series
(read
): Retrieve a specific exchange's timeseries data
-
retrieve_v1_metrics_markets
(read
): Retrieve a specific market -
list_v1_metrics_markets
(read
): Retrieve a list of markets
-
list_markets_v1_metrics_metrics
(read
): Get metric catalog of datasets for markets.
-
retrieve_metrics_markets_v1_metrics_time_series
(read
): Retrieve a specific market's timeseries data -
retrieve_with_granularity_metrics_markets_v1_metrics_time_series
(read
): Retrieve a specific market's timeseries data
-
retrieve_v1_metrics_networks
(read
): Retrieve a specific network -
list_v1_metrics_networks
(read
): Retrieve a list of networks
-
list_v2_metrics_assets
(read
): Retrieve a list of assets -
retrieve_ath_v2_metrics_assets
(read
): Retrieve a specific asset's ATH -
retrieve_details_v2_metrics_assets
(read
): Retrieve a specific asset's details -
retrieve_roi_v2_metrics_assets
(read
): Retrieve a specific asset's ROI
-
list_assets_v2_metrics_metrics
(read
): Get metric catalog of datasets for assets.
-
retrieve_metrics_assets_v2_metrics_time_series
(read
): Retrieve a specific asset's timeseries data -
retrieve_with_granularity_metrics_assets_v2_metrics_time_series
(read
): Retrieve a specific asset's timeseries data
-
list_v2_metrics_networks
(read
): Retrieve a list of networks
-
list_networks_v2_metrics_metrics
(read
): Get metric catalog of datasets for networks.
-
retrieve_metrics_networks_v2_metrics_time_series
(read
): Retrieve a specific network's timeseries data -
retrieve_with_granularity_metrics_networks_v2_metrics_time_series
(read
): Retrieve a specific network's timeseries data
-
list_assets_v1_news_news
(read
): Get News Feed Assets -
list_sources_v1_news_news
(read
): Get News Sources -
retrieve_feed_v1_news_news
(read
): Gets the news feed for the user
-
get_allocations_token_unlocks_v1
(read
): Returns allocation information given a set of asset IDs and optional filters
-
list_v1_token_unlocks_assets
(read
): Returns assets with allocation information given a set of filters -
get_events_v1_token_unlocks_assets
(read
): Returns unlock events for a given asset -
get_unlocks_v1_token_unlocks_assets
(read
): Returns interval-based unlock timeseries data for a given asset and interval -
get_vesting_schedule_v1_token_unlocks_assets
(read
): Returns vesting schedule timeseries data for a given asset
-
list_permissions_v1_user_management_api
(read
): Returns all available permissions with flags indicating which ones are granted to the current user
-
get_allowance_api_v1_user_management_credits
(read
): Returns the current credit allowance for the team
-
create_watchlist_v1_user_management_watchlists
(write
): Create a new watchlist for the authenticated user -
delete_watchlist_v1_user_management_watchlists
(write
): Delete a specific watchlist by ID for the authenticated user -
get_watchlist_v1_user_management_watchlists
(read
): Get a specific watchlist by ID for the authenticated user -
list_watchlists_v1_user_management_watchlists
(read
): Get all watchlists for the authenticated user -
modify_watchlist_assets_v1_user_management_watchlists
(write
): Modify the assets in a specific watchlist by ID for the authenticated user
-
retrieve_v0_signal_assets
(read
): Retrieve a specific asset -
list_v0_signal_assets
(read
): Retrieve a list of Assets
-
retrieve_time_series_assets_v0_signal_mindshare
(read
): Retrieve a specific asset's mindshare timeseries data -
retrieve_with_granularity_time_series_assets_v0_signal_mindshare
(read
): Retrieve a specific asset's mindshare timeseries data
-
list_classes_v0_signal_topics
(read
): Retrieve a list of topic classes
-
list_current_topics_v0_signal_global
(read
): Retrieve a list of current global topics -
list_daily_topics_v0_signal_global
(read
): Retrieve a timeseries of global topics
-
retrieve_v0_signal_x_users
(read
): Retrieve a specific X User -
list_v0_signal_x_users
(read
): Get a list of X users
-
retrieve_engagement_x_users_v0_signal_time_series
(read
): Retrieve a specific X User's engagement timeseries data -
retrieve_mindshare_with_granularity_x_users_v0_signal_time_series
(read
): Retrieve a specific X User's mindshare timeseries data