Skip to content

Improve MCP #12

@Arian-Ott

Description

@Arian-Ott

Hello,

All relevant features in Hyperion should be accessible via MCP. The goal is to enable LLMs to use hyperion's core features like Patching devices, checking DMX values or even create a show.

For that a fundamental implementation exists, however, it lacks of many details such as authentication.

Context

Currently there is an implementation attempt using the mcp library with one test function.

MCP Server: https://github.com/Arian-Ott/hyperion/backend/src/mcp_server.py

MCP Auth Service: https://github.com/Arian-Ott/hyperion/blob/master/backend/src/services/mcp_auth.py

Database Model:

class MCPToken(Base, TimestampMixin):
__tablename__ = "mcp_tokens"
id = Column(UUID, primary_key=True, default=uuid.uuid7)
account_id = Column(UUID, ForeignKey("accounts.id"))
token = Column(String(128), unique=True, index=True)
expires_at = Column(DateTime, nullable=False)

MCP Token endpoint:

@account_router.post("/accounts/mcp")
async def post_create_mcp_token(db=Depends(get_db), current_user=Depends(require_operator)):
try:
service = MCPAuthService(db)
mcp_token = await service.create_mcp_token(current_user.id)
return mcp_token
except:
raise HTTPException(500)

DoD

  • Implement MCP in fastapi
  • User can create an MCP token and use it in their LLM software (testing can be done using postman)
  • Token expires after 30 days (SQL Event exists)
  • LLM has the same priveleges as the user (If an Admin user creates a Token, the LLM has admin access too)
  • Destructive actions are not included as tool (e.g. delete all users or so)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions