A Model Context Protocol (MCP) server for operating the Pixela API, implemented in Go.
This MCP server supports the following Pixela API operations as tools:
- create_user: Create a user on Pixela
- update_user: Update user authentication token
- update_user_profile: Update user profile information
- delete_user: Delete a user
- create_graph: Create a graph for a user
- update_graph: Update a graph definition
- delete_graph: Delete a specific graph
- get_graphs: Get all graph definitions for a user
- get_graph_definition: Get a specific graph definition
- post_pixel: Post a pixel to a graph
- update_pixel: Update a pixel
- delete_pixel: Delete a pixel
- get_pixels: Get a list of pixels
- get_pixel: Get a specific pixel
- get_latest_pixel: Get the latest pixel
- get_today_pixel: Get today's pixel
- batch_post_pixels: Batch post pixels
- increment_pixel: Increment today's pixel
- decrement_pixel: Decrement today's pixel
- add_pixel: Add a value to today's pixel (Pixela Instant recording
/addendpoint) - subtract_pixel: Subtract a value from today's pixel (Pixela Instant recording
/subtractendpoint) - stopwatch: Start or stop the stopwatch for a specific graph (Pixela Instant recording
/stopwatchendpoint)
- create_webhook: Create a webhook
- get_webhooks: Get a list of webhooks
- invoke_webhook: Invoke a webhook
- delete_webhook: Delete a webhook
- Go 1.21 or later
- Pixela account (https://pixe.la/)
git clone https://github.com/a-know/pixela-mcp.git
cd pixela-mcp
go mod tidy
go run .git clone https://github.com/a-know/pixela-mcp.git
cd pixela-mcp
docker-compose up -dor
docker build -t pixela-mcp .
docker run -it --rm pixela-mcpNote: The server communicates via standard input/output (MCP protocol). It does not listen on a TCP port.
{
"mcpServers": {
"pixela": {
"command": "go",
"args": ["run", "."],
"cwd": "/path/to/pixela-mcp"
}
}
}or for Docker:
{
"mcpServers": {
"pixela-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "pixelaapi/pixela-mcp"]
}
}
}(ツール名・説明・パラメータは main.go の handleToolsList 実装に完全準拠)
-
create_user
username(string): User nametoken(string): Authentication tokenagreeTermsOfService(string): Agreement to the terms of service ("yes"/"no")notMinor(string): Confirmation of not being a minor ("yes"/"no")
-
update_user
username(string): User nametoken(string): Current authentication tokennewToken(string): New authentication token
-
update_user_profile
username(string): User nametoken(string): Authentication tokendisplayName(string, optional): Display namegravatarIconEmail(string, optional): Gravatar icon email addresstitle(string, optional): Titleabout(string, optional): AboutpixelaGraph(string, optional): Pixela graph URLtimezone(string, optional): TimezonecontributeURLs(string, optional): Contribute URLs (comma-separated)
-
delete_user
username(string): User nametoken(string): Authentication token
-
create_graph
username,token,graphID,name,unit,type,color(all string, required)
-
update_graph
username,token,graphID(required)name,unit,color,purgeCacheURLs,selfSufficient,isSecret,publishOptionalData(optional)
-
delete_graph
username,token,graphID(all string, required)
-
get_graphs
username,token(both string, required)
-
get_graph_definition
username,token,graphID(all string, required)
-
post_pixel
username,token,graphID,date,quantity(all string, required)
-
update_pixel
username,token,graphID,date,quantity(all string, required)optionalData(string, optional)
-
delete_pixel
username,token,graphID,date(all string, required)
-
get_pixels
username,token,graphID(required)from,to,mode(optional)
-
get_pixel
username,token,graphID,date(all string, required)
-
get_latest_pixel
username,token,graphID(all string, required)
-
get_today_pixel
username,token,graphID(all string, required)
-
batch_post_pixels
username,token,graphID,pixels(all string, required;pixelsis JSON array)
-
increment_pixel / decrement_pixel
username,token,graphID(all string, required)
-
add_pixel
username(string, required): User nametoken(string, required): Authentication tokengraphID(string, required): Graph IDquantity(string, required): Value to add (as string)
-
subtract_pixel
username(string, required): User nametoken(string, required): Authentication tokengraphID(string, required): Graph IDquantity(string, required): Value to subtract (as string)
-
stopwatch
username(string, required): User nametoken(string, required): Authentication tokengraphID(string, required): Graph ID
-
create_webhook
username,token,graphID,type(all string, required)quantity(string, optional)
-
get_webhooks
username,token(both string, required)
-
invoke_webhook
username,webhookHash(both string, required)
-
delete_webhook
username,token,webhookHash(all string, required)
- Implements MCP protocol version
2024-11-05(JSON-RPC 2.0 over stdio) - All tool definitions and parameters are dynamically listed via
tools/list - Pixela API quirks (e.g., type inconsistencies) are handled internally
- Some Pixela API features require a supporter account or may be rate-limited
pixela-mcp/
├── main.go # MCP server entry point
├── tools.go # MCP tool implementations
├── main_test.go # Tests
├── pixela/
│ └── client.go # Pixela API client
├── go.mod
├── go.sum
├── Dockerfile
├── docker-compose.yml
├── .dockerignore
├── cursor_log.md
└── README.md
go test -vMIT License
a-know (https://github.com/a-know)