Skip to main content
Glama

Vercel で MCP サーバーを実行する

使用方法

MCP TypeScript SDK ドキュメント に従って、api/server.ts をツール、プロンプト、リソースで更新してください。

このテンプレートの Next.js バージョンもあります

Related MCP server: Next.js MCP Server Template

MCP クライアントの統合

このサーバーを MCP クライアントアプリケーションに追加する際は、デプロイメント URL の後に /mcp を付けて使用してください:

https://your-deployment-url.vercel.app/mcp

ツールの例

このテンプレートには、すぐに使い始められる 2 つのツール例が含まれています:

  • roll_dice - N 面ダイスを振ります(最小 2 面)

  • get_weather - 緯度、経度、都市名を使用して、場所の現在の気象データを取得します(API 経由)

これらのツールは、基本的な機能と API 統合パターンを示しています。独自のツールに置き換えてください。

Vercel で実行するための注意点

  • 効率的な実行のために Fluid compute が有効になっていることを確認してください

  • Fluid compute を有効にした後、vercel.json を開き、Vercel Pro または Enterprise アカウントを使用している場合は最大実行時間を 800 に調整してください

  • MCP テンプレートをデプロイする

ローカル開発

  • ローカル開発には vercel dev を実行してください

  • または、システムを任意のサーバーフレームワークに統合してください。

サンプルクライアント

scripts/test-streamable-http-client.mjs には、呼び出しを試すためのサンプルクライアントが含まれています。

node scripts/test-streamable-http-client.mjs https://mcp-on-vercel.vercel.app

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    A template for running Model Context Protocol servers on Vercel with Redis support, allowing developers to deploy their custom tools, prompts, and resources using the MCP TypeScript SDK.
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A template for building MCP servers in Next.js applications using the Vercel MCP Adapter. Provides a foundation for adding custom tools, prompts, and resources to any Next.js project with deployment support on Vercel.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A template for deploying MCP servers on Vercel with example tools for rolling dice and getting weather data. Provides a foundation for building custom MCP servers with tools, prompts, and resources that can be deployed to Vercel's serverless platform.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A template for deploying Model Context Protocol servers as Next.js routes using the mcp-handler adapter, enabling easy integration of MCP tools, prompts, and resources into any Next.js application.
    MIT