Skip to main content
Glama

Device Log MCP Server

Device Log MCP Server

A simple Model Context Protocol (MCP) server written in Python using the FastMCP SDK.
This server simulates reading logs from multiple device services and exposes them as MCP tools.


๐Ÿš€ Features

  • Exposes 4 tools:

    • get_activation_logs(serial_number)

    • get_lan_logs(serial_number)

    • get_wlan_logs(serial_number)

    • get_kafka_status(serial_number)

  • Simulates real logs for demo/testing.

  • Runs in stateless HTTP JSON mode โ†’ easy to test using curl.

  • Default port: 4000


๐Ÿงฉ Requirements

  • Python โ‰ฅ 3.10

  • MCP SDK (FastMCP)

Install dependencies using either uv or pip:

# Option 1: using uv (recommended) uv add "mcp[cli]" # Option 2: using pip python -m pip install "mcp[cli]"

โš™๏ธ Running the server

uv run python mcp_server.py

Output example:

๐Ÿš€ Starting Device Log MCP Server on port 4000... INFO: Uvicorn running on http://127.0.0.1:4000

๐Ÿงช Testing via curl

You can call each tool directly via /mcp endpoint.

Activation logs

curl -X POST http://127.0.0.1:4000/mcp -H "Content-Type: application/json" -H "Accept: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_activation_logs","arguments":{"serial_number":"SN12345"}}}'

LAN logs

curl -X POST http://127.0.0.1:4000/mcp -H "Content-Type: application/json" -H "Accept: application/json" -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_lan_logs","arguments":{"serial_number":"SN12345"}}}'

WLAN logs

curl -X POST http://127.0.0.1:4000/mcp -H "Content-Type: application/json" -H "Accept: application/json" -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_wlan_logs","arguments":{"serial_number":"SN12345"}}}'

Kafka status

curl -X POST http://127.0.0.1:4000/mcp -H "Content-Type: application/json" -H "Accept: application/json" -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"get_kafka_status","arguments":{"serial_number":"SN12345"}}}'

๐Ÿงฐ Example response

{ "jsonrpc": "2.0", "id": 1, "result": { "content": [ { "type": "text", "text": "[SN12345] Activation completed at step 4" } ] } }

๐Ÿ“ฆ Project structure

device-log-server/ โ”œโ”€โ”€ mcp_server.py โ””โ”€โ”€ README.md
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables retrieval of simulated device logs (activation, LAN, WLAN) and Kafka status for testing purposes by querying with device serial numbers.

  1. ๐Ÿš€ Features
    1. ๐Ÿงฉ Requirements
      1. โš™๏ธ Running the server
        1. ๐Ÿงช Testing via curl
          1. Activation logs
          2. LAN logs
          3. WLAN logs
          4. Kafka status
        2. ๐Ÿงฐ Example response
          1. ๐Ÿ“ฆ Project structure

            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/dodangnguyen96/mcp-server'

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