Allegro账户集成服务

一个用于集成个人Allegro账户的模型上下文协议(MCP)服务器,可通过AI助手访问订单、购买记录和关注商品等功能。

  • by Bilski311
  • Kotlin
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Bilski311/allegro-mcp

使用说明

Allegro MCP Server

A Model Context Protocol (MCP) server for integrating with your personal Allegro account. Access your orders, purchases, watched items, and more through AI assistants like Claude.

Features

  • OAuth Device Flow Authentication - Secure authentication with your Allegro account
  • View Orders - See your purchase history and order details
  • Watched Offers - Check items you're watching
  • User Info - Get your account information

Available MCP Tools

Tool Description
allegro_authenticate Start OAuth device authorization flow
allegro_complete_authentication Complete authentication with device code
allegro_check_auth_status Check if authenticated
allegro_get_my_info Get your account information
allegro_get_my_orders List your orders/purchases
allegro_get_order_details Get details of a specific order
allegro_get_watched_offers List offers you're watching
allegro_get_bought_items List items you've bought

Prerequisites

  • Java 21+
  • Allegro Developer Account with registered application

Setup

1. Register an Allegro Application

  1. Go to Allegro Developer Portal
  2. Create a new application
  3. Note your Client ID and Client Secret
  4. Set redirect URI to https://allegro.pl (for device flow)

2. Configure Environment Variables

export ALLEGRO_CLIENT_ID=your_client_id
export ALLEGRO_CLIENT_SECRET=your_client_secret

3. Build and Run

./gradlew bootRun

The MCP server will be available at http://localhost:8080/mcp

Usage with Claude Code

Add to your Claude Code MCP configuration:

{
  "mcpServers": {
    "allegro": {
      "command": "curl",
      "args": ["-N", "http://localhost:8080/mcp/sse"]
    }
  }
}

Or run in stdio mode (coming soon).

Authentication Flow

  1. Call allegro_authenticate tool
  2. Visit the provided URL in your browser
  3. Authorize the application
  4. Call allegro_complete_authentication with the device code
  5. You're now authenticated and can use other tools

Configuration

Property Default Description
allegro.client-id - Your Allegro Client ID
allegro.client-secret - Your Allegro Client Secret
allegro.sandbox false Use Allegro sandbox environment
server.port 8080 Server port

Development

Build

./gradlew build

Test

./gradlew test

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Disclaimer

This is an unofficial project and is not affiliated with Allegro. Use at your own risk.