You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@coinbase/agentkit-model-context-protocol

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinbase/agentkit-model-context-protocol

Model Context Protocol Extension of Coinbase Agentkit

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
181
-51.21%
Maintainers
0
Weekly downloads
 
Created
Source

AgentKit Extension - Model Context Protocol (MCP)

Anthropic Model Context Protocol (MCP) extension of AgentKit. Enables agentic workflows to interact with onchain actions.

Setup

Prerequisites

  • CDP API Key
  • Node.js 18 or higher

Installation

npm install @coinbase/agentkit-model-context-protocol @coinbase/agentkit @modelcontextprotocol/sdk

Usage

Basic Setup

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
import { getMcpTools } from "@coinbase/agentkit-model-context-protocol";
import { AgentKit } from "@coinbase/agentkit";

const agentKit = await AgentKit.from({
  cdpApiKeyName: "CDP API KEY NAME",
  cdpApiKeyPrivateKey: "CDP API KEY PRIVATE KEY",
});

const { tools, toolHandler } = await getMcpTools(agentKit);

const server = new Server(
  {
    name: "agentkit",
    version: "0.1.0",
  },
  {
    capabilities: {
      tools: {},
    },
  },
);

server.setRequestHandler(ListToolsRequestSchema, async () => {
  return {
    tools,
  };
});

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  try {
    return toolHandler(request.params.name, request.params.arguments);
  } catch (error) {
    throw new Error(`Tool ${name} failed: ${error}`);
  }
});

const transport = new StdioServerTransport();

await server.connect(transport);

Contributing

See CONTRIBUTING.md for detailed setup instructions and contribution guidelines.

Keywords

coinbase

FAQs

Package last updated on 07 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts