Extend AI Toolkit MCP Server

MIT License
15
  • Apple
Integrations
  • Enables CrewAI agents to interact with Extend's platform for managing virtual cards, viewing credit cards, and checking transactions.

  • Offers toolkit integration with LangChain, supporting virtual card and spend management functionalities through Extend's API endpoints.

  • Provides tools for OpenAI's frameworks to interact with Extend APIs, enabling agents to manage virtual cards, credit cards, and transactions.

AIツールキットの拡張

概要

Extend AI Toolkitは、AnthropicのModel Context Protocol(MCP)OpenAILangChainCrewAIなど、複数のAIフレームワークのExtend APIと統合するためのツールをPythonベースで実装します。これにより、ユーザーは支出管理フローにおける特定のアクションをAIエージェントやClaudeデスクトップなどのMCP対応クライアントに委任できます。

これらのツールは、APIキーをお持ちの既存のExtendユーザー向けに設計されています。Extendにまだご登録いただいておらず、中小企業向けの最新かつ使いやすいバーチャルカードおよび支出管理プラットフォームについて詳しく知りたい方は、 paywithextend.comをご覧ください。

特徴

  • 複数の AI フレームワークのサポート: Anthropic Model Context Protocol、OpenAI Agents、LangChain LangGraph & ReAct、CrewAI フレームワークで動作します。
  • 包括的なツールセット: クレジットカード、バーチャルカード、取引、経費管理エンドポイントにわたるExtendの主要なAPI機能をすべてサポートします。

インストール

パッケージを変更する場合を除き、このソースコードは必要ありません。パッケージを使用するだけの場合は、以下を実行してください。

pip install extend_ai_toolkit

要件

  • Python : バージョン3.10以上
  • Extend APIキー: paywithextend.comにサインアップしてAPIキーを取得します
  • フレームワーク固有の要件:
    • LangChain: langchainおよびlangchain-openaiパッケージ
    • OpenAI: openaiパッケージ
    • CrewAI: crewaiパッケージ
    • Anthropic: anthropicパッケージ (Claude 用)

構成

ライブラリは、環境変数またはコマンドライン引数を使用して、Extend API キーと API を使用して構成する必要があります。

--api-key=your_api_key_here --api-secret=your_api_secret_here

または環境変数経由:

EXTEND_API_KEY=your_api_key_here EXTEND_API_SECRET=your_api_secret_here

利用可能なツール

ツールキットには、機能別に整理された包括的なツール セットが用意されています。

バーチャルカード

  • get_virtual_cards : オプションのフィルターを使用して仮想カードを取得します
  • get_virtual_card_detail : 特定の仮想カードの詳細情報を取得する

クレジットカード

  • get_credit_cards : すべてのクレジットカードを一覧表示する
  • get_credit_card_detail : 特定のクレジットカードの詳細情報を取得する

取引

  • get_transactions : さまざまなフィルターを使用してトランザクションを取得する
  • get_transaction_detail : 特定のトランザクションに関する詳細情報を取得する
  • update_transaction_expense_data : トランザクションの経費関連データを更新する

経費管理

  • get_expense_categories : すべての経費カテゴリを一覧表示する
  • get_expense_category : 特定の経費カテゴリの詳細を取得する
  • get_expense_category_labels : 経費カテゴリのラベルを取得する
  • create_expense_category : 新しい経費カテゴリを作成する
  • create_expense_category_label : 経費カテゴリにラベルを追加する
  • update_expense_category : 既存の経費カテゴリを変更する
  • create_receipt_attachment : 領収書をアップロードする(オプションで取引に添付する)
  • automatch_receipts : アップロードされた領収書と取引を自動照合する非同期ジョブを開始します。
  • get_automatch_status : 自動マッチジョブのステータスを取得する
  • send_receipt_reminder : レシートがない取引のリマインダーを(メールで送信)送信します

使用例

モデルコンテキストプロトコル

ツールキットは、MCP サーバーの構築に役立つリソースをextend_ai_toolkit.modelcontextprotocolパッケージに提供します。

発達

MCP Inspector を使用してローカルで MCP サーバーの拡張をテストします。

npx @modelcontextprotocol/inspector python extend_ai_toolkit/modelcontextprotocol/main.py --tools=all
クロードデスクトップ統合

設定ファイルを編集して、このツールを MCP サーバーとして Claude Desktop に追加します。

MacOS の場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

claude デスクトップで create_receipt_attachment ツールを使用する場合はnpm install @modelcontextprotocol/server-filesystem add を使用してファイルシステム mcp サーバーをインストールし、構成ファイルにも追加する必要があります。

ご注意:現在の制限により、Claude Desktopに直接アップロードされた画像はExtendにアップロードできません。これは、Claude Desktopアプリが基盤となる画像データにアクセスできないためです。そのため、ファイルシステムMCPサーバーが必要となります。

ファイルシステムの追加により、レシート専用のフォルダを作成し、Claude にレシートをアップロードして、最も可能性の高い取引と自動照合するように指示できます。また、レシートを添付したい取引が分かっている場合は、その取引のレシートをアップロードするように指示することで、自動照合プロセスをスキップできます。

{ "extend-mcp": { "command": "python", "args": [ "-m", "extend_ai_toolkit.modelcontextprotocol.main", "--tools=all" ], "env": { "EXTEND_API_KEY": "apik_XXXX", "EXTEND_API_SECRET": "XXXXX" } }, // optional: if you want to use the create_receipt_attachment tool "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/path/to/receipts/folder" ] } }
リモート実行

サーバーをリモートで実行し、SSE トランスポート経由で通信することもできます。

python -m extend_ai_toolkit.modelcontextprotocol.main_sse --tools=all --api-key="apikey" --api-secret="apisecret"

オプションでMCPターミナルクライアントを使用して接続します。

python -m extend_ai_toolkit.modelcontextprotocol.client.mcp_client --mcp-server-host localhost --mcp-server-port 8000 --llm-provider=anthropic --llm-model=claude-3-5-sonnet-20241022

オープンAI

import os from langchain_openai import ChatOpenAI from extend_ai_toolkit.openai.toolkit import ExtendOpenAIToolkit from extend_ai_toolkit.shared import Configuration, Scope, Product, Actions # Initialize the OpenAI toolkit extend_openai_toolkit = ExtendOpenAIToolkit.default_instance( api_key=os.environ.get("EXTEND_API_KEY"), api_secret=os.environ.get("EXTEND_API_SECRET"), configuration=Configuration( scope=[ Scope(Product.VIRTUAL_CARDS, actions=Actions(read=True)), Scope(Product.CREDIT_CARDS, actions=Actions(read=True)), Scope(Product.TRANSACTIONS, actions=Actions(read=True)), ] ) ) # Create an agent with the tools extend_agent = Agent( name="Extend Agent", instructions="You are an expert at integrating with Extend", tools=extend_openai_toolkit.get_tools() )

ランチェーン

import os from langchain_openai import ChatOpenAI from langgraph.prebuilt import create_react_agent from extend_ai_toolkit.langchain.toolkit import ExtendLangChainToolkit from extend_ai_toolkit.shared import Configuration, Scope, Product, Actions # Initialize the LangChain toolkit extend_langchain_toolkit = ExtendLangChainToolkit.default_instance( api_key=os.environ.get("EXTEND_API_KEY"), api_secret=os.environ.get("EXTEND_API_SECRET"), configuration=Configuration( scope=[ Scope(Product.VIRTUAL_CARDS, actions=Actions(read=True)), Scope(Product.CREDIT_CARDS, actions=Actions(read=True)), Scope(Product.TRANSACTIONS, actions=Actions(read=True)), ] ) ) # Create tools for the agent tools = extend_langchain_toolkit.get_tools() # Create the agent executor langgraph_agent_executor = create_react_agent( ChatOpenAI(model="gpt-4"), tools )

クルーAI

import os from extend_ai_toolkit.crewai.toolkit import ExtendCrewAIToolkit from extend_ai_toolkit.shared import Configuration, Scope, Product, Actions # Initialize the CrewAI toolkit toolkit = ExtendCrewAIToolkit.default_instance( api_key=os.environ.get("EXTEND_API_KEY"), api_secret=os.environ.get("EXTEND_API_SECRET"), configuration=Configuration( scope=[ Scope(Product.VIRTUAL_CARDS, actions=Actions(read=True)), Scope(Product.CREDIT_CARDS, actions=Actions(read=True)), Scope(Product.TRANSACTIONS, actions=Actions(read=True)), ] ) ) # Configure the LLM (using Claude) toolkit.configure_llm( model="claude-3-opus-20240229", api_key=os.environ.get("ANTHROPIC_API_KEY") ) # Create the Extend agent extend_agent = toolkit.create_agent( role="Extend Integration Expert", goal="Help users manage virtual cards, view credit cards, and check transactions efficiently", backstory="You are an expert at integrating with Extend, with deep knowledge of virtual cards, credit cards, and transaction management.", verbose=True ) # Create a task for handling user queries query_task = toolkit.create_task( description="Process and respond to user queries about Extend services", agent=extend_agent, expected_output="A clear and helpful response addressing the user's query", async_execution=True ) # Create a crew with the agent and task crew = toolkit.create_crew( agents=[extend_agent], tasks=[query_task], verbose=True ) # Run the crew result = crew.kickoff()

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

AI エージェントが Extend の支出管理 API と対話できるようにし、自然言語による仮想カード管理、取引追跡、領収書処理を可能にする MCP サーバー。

  1. 概要
    1. 特徴
      1. インストール
        1. 要件
      2. 構成
        1. 利用可能なツール
          1. バーチャルカード
          2. クレジットカード
          3. 取引
          4. 経費管理
        2. 使用例
          1. モデルコンテキストプロトコル
          2. オープンAI
          3. ランチェーン
          4. クルーAI
        3. 貢献
          1. ライセンス

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              An MCP server that lets AI assistants interact with your Lunchmoney data, enabling natural language queries about transactions, budgets, and spending patterns.
              Last updated -
              4
              3
              8
              TypeScript
              MIT License
            • -
              security
              A
              license
              -
              quality
              An MCP server that helps AI assistants manage expense-sharing for social events, enabling the creation of gatherings, tracking of expenses, and calculation of fair reimbursements among participants.
              Last updated -
              Python
              Apache 2.0
            • A
              security
              F
              license
              A
              quality
              An MCP server that integrates with Fewsats allowing AI agents to securely purchase anything by retrieving balances, accessing payment methods, and processing payments.
              Last updated -
              4
              11
              Python
            • -
              security
              -
              license
              -
              quality
              A specialized MCP server that enables AI agents to interact with Reddit, including reading posts, creating content, and managing subreddit configurations.
              Last updated -
              31
              1
              TypeScript

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/paywithextend/extend-ai-toolkit'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server