Skip to content

feat: appkit mcp server and client #4080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft

feat: appkit mcp server and client #4080

wants to merge 33 commits into from

Conversation

enesozturk
Copy link
Contributor

AppKit MCP Server & Client Implementation

Introducing AppKit MCP -- A Model Context Protocol (MCP) server that let your AI applications communicate with your wallet and any onchain data with AppKit API.

MCP Server

The MCP server running on Next.js API Routes. You can see the following endpoints to implement the MCP Server TypeScript SDK:

MCP Client

The client uses AI SDK to implement chat experience and communicate with the MCP server via any LLM.

Overview

This MCP server extends any MCP client's capabilities by providing tools to do anything on Base:

  • Get wallet addresses
  • List wallet balances on any network
  • Send tokens between wallets
  • Swap tokens
  • Buy tokens
  • Get your transaction history on any network
  • ENS lookup
  • ENS reverse lookup
  • Get gas price of any network

and more.

Note

This work is still in progress

Showcase

appkit-ai-hd.mp4

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

changeset-bot bot commented Mar 26, 2025

⚠️ No Changeset found

Latest commit: 0c3aed7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Mar 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-chat ❌ Failed (Inspect) Apr 29, 2025 5:39pm
appkit-demo ❌ Failed (Inspect) Apr 29, 2025 5:39pm
appkit-laboratory ❌ Failed (Inspect) 💬 Add feedback Apr 29, 2025 5:39pm
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-basic-ep-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-basic-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-basic-up-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-ethers5-bera ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-nansen-demo ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-vue-solana ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Apr 29, 2025 5:39pm
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm
vue-wagmi-example ⬜️ Ignored (Inspect) Apr 29, 2025 5:39pm

Copy link

socket-security bot commented Apr 6, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​ai-sdk/​react@​1.2.9991007297100
Addedtailwindcss-animate@​1.0.710010010076100
Added@​open-wc/​testing@​4.0.01001009381100
Added@​ai-sdk/​openai@​1.3.181001008497100
Added@​modelcontextprotocol/​inspector@​0.6.0871009396100
Added@​modelcontextprotocol/​sdk@​1.10.29910010096100

View full report

Copy link
Contributor

github-actions bot commented Apr 23, 2025

Fails
🚫 Loose dependency versions in apps/appkit-chat/package.json, please use strict versioning
🚫 Loose dependency versions in apps/appkit-chat/package.json, please use strict versioning
🚫 apps/appkit-chat/app/api/chat/route.ts uses localhost: which is likely a mistake
🚫 packages/mcp-server/src/tools/send.ts uses localhost: which is likely a mistake
🚫 packages/mcp-server/src/tools/swap.ts uses localhost: which is likely a mistake
Warnings
⚠️ File apps/laboratory/tests/email-after-farcaster.spec.ts contains a KEY or SECRET
⚠️ File apps/laboratory/tests/email.spec.ts contains a KEY or SECRET
⚠️ File packages/appkit-utils/src/CaipNetworkUtil.ts contains a KEY or SECRET
⚠️ File packages/appkit/src/client/appkit-base-client.ts contains a KEY or SECRET
⚠️ File packages/blockchain-api/tests/FetchUtil.test.ts contains a KEY or SECRET
⚠️ File packages/controllers/package.json contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/AccountController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ApiController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/RouterController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/SendController.ts contains a KEY or SECRET
⚠️ File packages/experimental/package.json contains a KEY or SECRET
⚠️ File packages/experimental/src/smart-session/controllers/SmartSessionsController.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/partials/w3m-input-address/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/partials/w3m-swap-input/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/views/w3m-account-view/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/views/w3m-network-switch-view/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/views/w3m-networks-view/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/views/w3m-swap-view/index.ts contains a KEY or SECRET
⚠️ File packages/wallet-button/package.json contains a KEY or SECRET
⚠️ File packages/wallet-button/src/controllers/ApiController.ts contains a KEY or SECRET
⚠️ File packages/wallet/package.json contains a KEY or SECRET
⚠️ File packages/wallet/src/W3mFrameSchema.ts contains a KEY or SECRET
⚠️ File apps/appkit-chat/.env.example contains a KEY or SECRET
⚠️ File apps/appkit-chat/README.md contains a KEY or SECRET
⚠️ File apps/appkit-chat/app/api/chat/route.ts contains a KEY or SECRET
⚠️ File apps/appkit-chat/app/layout.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/chat-input.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/chat-messages.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/markdown.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/memoized-markdown.tsx contains a KEY or SECRET
⚠️ File packages/blockchain-api/package.json contains a KEY or SECRET
⚠️ File packages/blockchain-api/src/utils/FetchUtil.ts contains a KEY or SECRET
⚠️ File packages/mcp-server/README.md contains a KEY or SECRET
⚠️ File apps/appkit-chat/.env.example contains a KEY or SECRET
⚠️ File apps/appkit-chat/README.md contains a KEY or SECRET
⚠️ File apps/appkit-chat/app/api/chat/route.ts contains a KEY or SECRET
⚠️ File apps/appkit-chat/app/layout.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/chat-input.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/chat-messages.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/markdown.tsx contains a KEY or SECRET
⚠️ File apps/appkit-chat/components/memoized-markdown.tsx contains a KEY or SECRET
⚠️ File packages/blockchain-api/package.json contains a KEY or SECRET
⚠️ File packages/blockchain-api/src/utils/FetchUtil.ts contains a KEY or SECRET
⚠️ File packages/mcp-server/README.md contains a KEY or SECRET

Generated by 🚫 dangerJS against 0c3aed7

Copy link
Contributor

github-actions bot commented Apr 23, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.17% 26248 / 34914
🔵 Statements 75.17% 26248 / 34914
🔵 Functions 66.32% 2204 / 3323
🔵 Branches 83.23% 5113 / 6143
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit-utils/src/CaipNetworkUtil.ts 85.53% 98.68% 92% 85.53% 255, 311-355
packages/appkit/src/client/appkit-base-client.ts 74.19% 88.41% 77.48% 74.19% 187-188, 190-191, 196-197, 276-277, 313-319, 353-354, 375-381, 384-385, 401-402, 435-439, 452-467, 492-498, 501-511, 514-526, 529-531, 534-536, 539-541, 544-546, 549-555, 558-561, 577-589, 595-628, 631-641, 694-695, 701, 712-726, 732-739, 752-756, 797, 839-843, 849-850, 862, 885-890, 961, 965-966, 972, 993-994, 1004, 1006-1022, 1027, 1066-1067, 1080-1091, 1123-1130, 1176-1180, 1209-1212, 1216, 1232-1242, 1264-1275, 1304-1305, 1311-1337, 1493-1494, 1522-1523, 1526-1527, 1542-1545, 1548-1549, 1569-1570, 1573-1574, 1596-1597, 1611, 1619, 1622, 1626, 1631-1650, 1653-1662, 1677-1678, 1721-1724, 1727-1728, 1816-1817, 1820-1823, 1826-1827, 1830-1831, 1834-1835, 1838-1839, 1842-1846, 1855-1864, 1873-1884, 1271, 1633-1654
packages/blockchain-api/exports/index.ts 100% 100% 100% 100%
packages/blockchain-api/src/api/BlockchainApiClient.ts 29.26% 70.58% 37.03% 29.26% 116-117, 122, 124-128, 139-142, 165-179, 187-204, 212-220, 228-243, 273-286, 294-314, 322-337, 347-359, 367-371, 381-391, 399-403, 411-422, 430-446, 456-468, 476-496, 504-513, 523-537
packages/blockchain-api/src/utils/FetchUtil.ts 60.67% 73.68% 66.66% 60.67% 16-17, 48-50, 57-58, 65-66, 78-79, 82-92, 95-105, 120-121, 125-126
packages/blockchain-api/src/utils/constants.ts 100% 100% 100% 100%
packages/common/src/utils/TypeUtil.ts 100% 100% 100% 100%
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/exports/utils.ts 100% 100% 100% 100%
packages/controllers/src/controllers/AccountController.ts 91.58% 95.38% 68.62% 91.58% 61-62, 69-73, 106, 156, 233-236, 258, 81, 190, 215-235
packages/controllers/src/controllers/ApiController.ts 94.48% 91.57% 89.36% 94.48% 105-106, 167, 174-175, 354-362, 399, 403, 407
packages/controllers/src/controllers/BlockchainApiController.ts 33.1% 76.47% 19.14% 33.1% 61-67, 79-83, 95-96, 100-101, 115-136, 140-147, 151-160, 164-171, 179-180, 186-193, 197-210, 214-225, 239-254, 258-265, 269-278, 282-289, 293-305, 309-328, 332-339, 343-360, 364-374, 378-386
packages/controllers/src/controllers/EventsController.ts 100% 90.9% 85.71% 100%
packages/controllers/src/controllers/RouterController.ts 59.63% 96.15% 80% 59.63% 147-177, 226-237, 242-249
packages/controllers/src/controllers/SendController.ts 61.56% 71.69% 60.97% 61.56% 121-123, 125, 153-174, 217-231, 239-240, 252-253, 265-301, 319, 321-335, 339-355, 144-298
packages/experimental/src/smart-session/controllers/SmartSessionsController.ts 62.29% 61.53% 57.14% 62.29% 52-56, 58-81, 89-90, 97-98, 154-155, 163-166, 170-171, 174-176, 184-185, 193, 199-238
packages/scaffold-ui/src/partials/w3m-input-address/index.ts 97.5% 96.66% 88.23% 97.5% 45-46, 95
packages/scaffold-ui/src/partials/w3m-swap-input/index.ts 85.71% 86.2% 83.33% 85.71% 83, 88-91, 95-96, 101, 103, 123, 143, 150, 159, 166, 171
packages/scaffold-ui/src/views/w3m-account-view/index.ts 54.79% 41.66% 54.54% 54.79% 24, 30-31, 41-42, 49, 51, 56-57, 76-86, 90-97, 103, 113-124
packages/scaffold-ui/src/views/w3m-network-switch-view/index.ts 19.35% 100% 0% 19.35% 40-49, 52-53, 56-61, 65-117, 121-131, 134-142, 145-153, 156-167
packages/scaffold-ui/src/views/w3m-networks-view/index.ts 25% 100% 0% 25% 44-52, 55-56, 60-83, 87-98, 101-102, 109-111, 114-142, 145-159, 162-163
packages/scaffold-ui/src/views/w3m-swap-view/index.ts 70.8% 73.91% 88% 70.8% 109-113, 123-125, 128-130, 133-145, 168, 174-176, 189, 198-199, 202-203, 219, 232, 253, 257-283, 294-301, 323, 366-375, 393-409, 453-454, 471-472
packages/scaffold-ui/src/views/w3m-wallet-send-view/index.ts 78.01% 68.57% 80% 78.01% 117, 173-174, 196-224, 233-244
packages/wallet-button/src/controllers/ApiController.ts 100% 100% 100% 100%
packages/wallet/src/W3mFrameSchema.ts 100% 100% 100% 100%
Generated in workflow #11402 for commit 0c3aed7 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant