Skip to content

Conversation

@leej3
Copy link

@leej3 leej3 commented Jul 30, 2025

Add Context7 Configuration for NeuroConv

This pull request adds first‑class Context7 support for NeuroConv so that AI coding assistants (Cursor, Copilot Chat, Zed, etc.) can access version‑specific conversion guidance directly in prompts.

Benefits for users

  • Accurate version-specific code examples – agents retrieve current NeuroConv APIs instead of hallucinating.
  • Format‑aware recommendations – rules instruct models to pick the right *Interface and to validate with check_read().
  • Reproducibility – version history lets downstream projects pin documentation to a specific tag.

Details on the approach

I have tried to follow the best practices outlined in their document for guiding this. Some of the highlights are:

Item Purpose
context7.json Using this config file in the project source helps to control and optimize how the MCP server provides help for Neuroconv
Docs‑only crawl Source code, tests, CI files, and build artefacts are excluded, keeping responses focused and fast.
Schema validation The $schema key enables auto‑completion in IDEs and guarantees the file adheres to the Context7 JSON‑Schema.

leej3 and others added 2 commits July 30, 2025 12:12
- Add context7.json to enable AI coding assistant integration
- Configure documentation parsing for 40+ neurophysiology formats
- Include best practices for NWB conversion workflows
- Support for multiple recent versions (v0.6.7 - v0.7.5)
- Exclude source code and focus on user-facing documentation

This enables developers to get up-to-date NeuroConv documentation
directly in AI coding assistants like Cursor and Claude.
Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another similar solution is this:
https://github.com/ref-tools/ref-tools-mcp

On one hand, this is something extra to maintain but the document is really small and not very costly. Maybe we should just have it for the sake of experimentation. I am OK with it but we should improve the rules a bit.

@bendichter has been thinking hard about AI tools and I think he will be interested on this. Maybe @luiztauffer will be interested as well.

"Call get_metadata() and enrich the returned dict before running conversion.",
"Use run_conversion() with backend compression settings for large recordings.",
"Leverage chunking options to keep NWB files manageable.",
"Run check_read() on every interface before conversion to catch I/O issues early.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following rules from here to the end seem more dubious. I don't think we have a check_read for example.

@leej3
Copy link
Author

leej3 commented Jul 31, 2025

Another similar solution is this: https://github.com/ref-tools/ref-tools-mcp

Thanks, good to know. No doubt there will be others soon too.

On one hand, this is something extra to maintain but the document is really small and not very costly. Maybe we should just have it for the sake of experimentation. I am OK with it but we should improve the rules a bit.

Projects can be added directly to context7.com (by "community members") but the configuration is detected automatically and errors etc. are more likely to occur. Given there are competing projects in this area it does seem like there is a risk of over-committing on support. The downside of not doing the experimentation you propose would be that end users think it's supported but the efficiency/functionality of a well specified set of rules won't be part of the MCP server.

I don't have enough experience with the project to specify the rules (clearly, given I didn't pick up on the hallucinations!). I hope we can get something along these lines merged though. If I can help just let me know.

@bendichter has been thinking hard about AI tools and I think he will be interested on this. Maybe @luiztauffer will be interested as well.

Excellent.

@bendichter
Copy link
Contributor

@leej3 very cool that you are thinking about agentic coding for NWB conversions! As @h-mayorquin we have been looking pretty deep into this. I agree that some of the rules here are great but some of them are not really right and I think we are going to need a lot more for making actually good conversions. While I am excited about embracing AI to lower the energy barrier of open data, I worry about an agent like this creating and publishing technically correct NWB files that do not have the appropriate data. For example having the neurophysiology signal, but missing key (or all) stimulus and behavioral information. This is a common problem already in the DANDI Archive and I think an agent like this might make it worse if we don't think very carefully about how we guide it. Would you be open to a meeting to discuss this?

Comment on lines +23 to +29
"excludeFiles": [
"CHANGELOG.md",
"license.txt",
"MANIFEST.in",
"pyproject.toml",
"CITATION.cff",
"codecov.yml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Context7 project website says it does version-specific documentation and code examples. If that's the case, wouldn't it make sense to keep CHANGELOG.md?

Also, it feels like pyproject.toml is relevant, since agents might need to debug failures caused by missing dependencies and similar issues.

@luiztauffer
Copy link
Member

The downside of not doing the experimentation you propose would be that end users think it's supported but the efficiency/functionality of a well specified set of rules won't be part o

I think the discussion on fully agentic conversions is one step beyond what is being proposed here by @leej3

Context7 seems to be simply a way to efficiently parse and catalog documentations of open source projects which could be used by LLMs in general, e.g. for our daily work with cline.

If this works (I’ve never tried it nor its alternatives) it would be a more sustainable approach than what I was trying to do by maintaining a vector database for NeuroConv.

@leej3
Copy link
Author

leej3 commented Aug 4, 2025

on fully agentic conversions is one step beyond what is being proposed here by @leej3

Agreed. Though what I propose here is a stepping stone to agentic supported conversion. I am indeed interested in exploring that.

If this works (I’ve never tried it nor its alternatives) it would be a more sustainable approach than what I was trying to do by maintaining a vector database for NeuroConv.

Yes, I think it should work well for your use case. It is helpful for guiding the project's development itself. Adding the mcp server to your tools will be a lower maintenance approach than the local vector database (though I'd be interested to here of deterioration in performance).

One can use the context7.com interface to add a project but the configuration file I propose in this PR (once carefully updated to fully represent the best practices of the tool) will provide context7 with better information to create the mcp server. So the results will be better for any downstream users.

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.

4 participants