T
tscircuit•5mo ago
C4

tscircuit MCP

https://github.com/charlielockyer-rice/tscircuit-mcp Built a basic MCP for accessing the tscircuit registry with Claude directly. Should be helpful for more future AI integrations. I have it set up now where I can use Claude Desktop to directly search the registry and return component code. Claude Code did lots of the heavy lifting - if anyone has any thoughts or comments, please let me know!
GitHub
GitHub - charlielockyer-rice/tscircuit-mcp: An MCP for tscircuit.
An MCP for tscircuit. Contribute to charlielockyer-rice/tscircuit-mcp development by creating an account on GitHub.
31 Replies
Rishabh
Rishabh•5mo ago
Nice!! This is a great initiative. Haven't tried it yet, but would check this out
Seve
Seve•5mo ago
this is sweet!
C4
C4OP•5mo ago
Thinking about more ways to make this useful. Question on data structure - is there currently a well-defined mechanism for tracking attributes of a component, like operating voltage, current limits, etc. (stuff you'd see on a datasheet)? I ask bc this could be useful for queries like "find me a temperature sensor that works with my existing architecture" where the MCP may return lots of options, but making an informed choice requires more info. I could set it up to return basically all the component data and have the LLM try to parse it for info, but not sure how well that will scale. For example: https://tscircuit.com/imrishabh18/air-quality-sensor#schematic The schematic notes that this is a 3.3v component, but that's the only place I can find that info in the part description. That's fine for a part like this, but in more complex examples (like microcontrollers with both 3V3 and a 5V VBUS), it might be more difficult to make informed decisions on which part to choose. Not sure if it already exists, but if we could tie data from part datasheets directly to part data in the registry, that would be a big step forward once the package registry expands to include many more parts.
undefined - tscircuit
A tscircuit component created by imrishabh18
Seve
Seve•5mo ago
there aren't that many components in the registry yet, you might want to use https://jlcsearch.tscircuit.com which also has an API and return components converted to easyeda using the easyeda module (which we develop here: https://github.com/tscircuit/easyeda-converter). That would allow people to instantly get full components for any part on jlc
zach
zach•2mo ago
I'll do it here guys
zach
zach•2mo ago
so here has been my entire process so far. Step 1: install tscircuit with init. Step 2: feed it my requirements document which is a high level PRD that outlines components like esp32 etc. Step 3: I asked codex to write the entire index.tsx from the requirements document after reading and understanding ai.txt Step 4: Now I am asking codex to call categories_list and search_parts to find the part number so it can do the imports for me. It is at this step that I am running out of context window.
No description
Seve
Seve•2mo ago
yea the ai.txt/llms.txt is probably too big i think we need a reduced version
zach
zach•2mo ago
Well it's normally fine That hasn't been an issue yet hold on i will try to compress my screen recording and share that
Seve
Seve•2mo ago
Our docs repo is here: https://github.com/tscircuit/docs We currently use repomix to generate the llms.txt
GitHub
GitHub - tscircuit/docs: docs, tutorials and guides for tscircuit (...
docs, tutorials and guides for tscircuit (Electronics with React/Typescript) - tscircuit/docs
Seve
Seve•2mo ago
I'm wondering if we can come up with specific files to include or find some way of reducing the context i'm sure there's lots of unnecessary stuff being added
zach
zach•2mo ago
I cached the entire sqlite on my machine I think the tool is loading that into context
Seve
Seve•2mo ago
oh that's not good lol honestly you should just give it the jlcsearch OpenAPI JSON haha it can just make search calls to avoid storing the db the only issue with that is the API doesn't have everything under the sun
Seve
Seve•2mo ago
GitHub
jlcsearch/docs/openapi.json at main · tscircuit/jlcsearch
Find parts from JLCPCB matching design constraints (resistance values, capacitance, tolerance etc.) - tscircuit/jlcsearch
zach
zach•2mo ago
how would it know how to construct the search query without loading the entire categories list into context?
Seve
Seve•2mo ago
yea that's really small tho 349KB
zach
zach•2mo ago
Oh ok so then maybe it's search_parts tool that's overloading it
Seve
Seve•2mo ago
probably smaller if you compress it somehow into a TXT
zach
zach•2mo ago
ok so i took that docs page and told codex to use that after doing categories_list
No description
zach
zach•2mo ago
I think this will be very interesting for you as a use case because I am an idiot 😂 I just have no clue about building boards
Seve
Seve•2mo ago
nice yea it's important to make sure people can just drop-in with ai
zach
zach•2mo ago
hmm this seems to be working. i wonder why it didn't understand this pattern from ai.txt
Seve
Seve•2mo ago
yea it's not really in the ai.txt 🤷
zach
zach•2mo ago
Oh got it I assumed anyways I am just keeping clicking approve
Seve
Seve•2mo ago
yea we might add a doc on it....
zach
zach•2mo ago
it's sent like 40 requests so far
Seve
Seve•2mo ago
ig that's a good sign what did you ask it to build
zach
zach•2mo ago
everything all at once an entire board with wifi, bluetooth, and uwb, onboard storage, and sensors
Seve
Seve•2mo ago
haha ok i mean i'm curious we don't benchmark on boards that are that difficult though
zach
zach•2mo ago
well im happy to share the requirements doc. like I said it's interesting because I have no concept of "hard" haha
Seve
Seve•2mo ago
yea sure i can take a peek and maybe adjust our benchmarks for more complex boards we have slowly been tackling harder problems, but there's a lot that can go wrong
zach
zach•2mo ago
I'd like to message you it directly ok it just finished the api calls and found some parts. some of my parts I was planning on doing consignment with jlcpcb because they don't stock it but apparently there is a process where you send them module and they can place it swapping to manual import because i can't figure out cli import or ai import. i just had ai tell me all the part numbers it found from the api calls

Did you find this page helpful?