Skip to content

MCP implementation #1

@radumarias

Description

@radumarias

Evolving this experiment.

Have a minimalistic MCP server that handles these

  • manage a folder where code for charts will be created
  • prepares a basic structure based on charts lib used
  • exposes this to LLM with instructions of what lib used and programming lang
  • starts a http server to serve the code in that folder
  • llm will directly change the files in there
  • then will call a tool from MCP to refresh the server to pick-up new code and refresh the viewer page

Implementation

Create MCP server

Use any coding agent to create a basic MCP server with typescript

Tools in MCP server

  • get_supported_charts_libs: returns unique libs info array derived from names of charts libs which we support. for now just use https://www.amcharts.com/
    example: [ { "id": "amcharts", "name": "amcharts", "instructions": "how to use the lib and any useful info" } ]
  • initialize_wk(chart_lib_id): will create the workspace folder and code template based on chart lib
  • get_wk_path: path of workspace folder
  • refresh: will reload the code on the server. Maybe restart the server or whatever is needed for the give framework.
    [todo]: think of a mechanism to refresh the viewer page, maybe with websockets

Tests

  • use any AI agent like Claude Code or any other agent
  • add postgres MPC to get data
  • add our charts MCP, config with code folder and http port
  • in AI agent ask for some data from postgres MCP
  • then ask to draw it with charts MCP
  • ask several changes
  • make sure all are rendered ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions