Skip to content

MCP Example#219

Open
ndebard wants to merge 3 commits intolanl:mainfrom
ndebard:ndebard/sqlite_mcp
Open

MCP Example#219
ndebard wants to merge 3 commits intolanl:mainfrom
ndebard:ndebard/sqlite_mcp

Conversation

@ndebard
Copy link
Copy Markdown
Collaborator

@ndebard ndebard commented Mar 28, 2026

This adds an example in examples/mcp_examples which provides a VERY simple MCP server that can marginally be thought of as useful for science (e.g. the S in URSA). It's an SQLite server - it has it's problems, but it's here to demonstrate functionality and demonstrate how to use MCP with a few things in URSA.

  1. the server has basic database like features - creating database, making tables, adding rows to tables, querying tables. these are all served up as MCP end points.
  2. there's a very simple test_sqlite_mcp.py which a user can run from this examples dir to see the thing work.
  3. there's a README.md that explains this, walks the user through running this and convincing themselves it works.
  4. finally, the README walks the user through using this functionality for a pseudo-scientific prompt (shown below, also in the README of course). The user does this in the dashboard, gets a cool plot, and realizes how awesome this functionality is. The entire time, we see it using the MCP services.

This is important to me b/c it provides a codified and documented workflow on how to do this, an example of how to improve upon it, etc.

Here's the fun prompt:

Use the sqlite_demo MCP tools to create a database called materials_demo
and a table called tensile_experiments with the following columns:
sample_id as a TEXT primary key, temperature_K as REAL, strain_rate_s as REAL,
grain_size_um as REAL, yield_strength_MPa as REAL, and phase_label as TEXT.

Then generate 100 synthetic rows of data using numpy with reasonable random
distributions: temperature_K uniformly between 250 and 1200, strain_rate_s
log-uniformly between 1e-4 and 1e1, grain_size_um normally distributed around
20 with a standard deviation of 5 and clipped to positive values, and
yield_strength_MPa computed from a simple synthetic relationship where strength
decreases with temperature, increases with strain rate, and increases slightly
as grain size decreases, plus some random noise.

Assign each row a sample_id from sample_001 to sample_100 and a phase_label
of alpha or beta based on whether temperature_K is below or above 700.

Insert all rows into the table, query the full table back out, and then plot
yield_strength_MPa versus temperature_K with points colored by phase_label.
Save this to an appropriate PNG filename.

Also print a short summary of the table contents and the fitted synthetic
trends you used.

The README includes some PNG screenshots also to show the user what they are supposed to get out of it. In some ways, it's a tiny tutorial of how to use this functionality in the dashboard.

@ndebard
Copy link
Copy Markdown
Collaborator Author

ndebard commented Mar 28, 2026

@mikegros or @luiarthur can you guys look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant