feat: standardize README structure and add auto-sync workflow#33
Conversation
- Update README to match standardized mcp-opinion format - Add npm and license badges - Restructure sections for consistency - Add AUTO-GENERATED TOOLS markers for tool documentation - Add sync-tools.yml workflow to auto-generate tool docs - Add generate-mcp-tools action to scan and document MCP tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @Royal-lobster, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's documentation and developer experience by standardizing the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the project's documentation and developer experience by standardizing the README.md and adding a workflow to automatically generate documentation for MCP tools. The new README structure is much clearer and more comprehensive. The script for auto-generating tool documentation is a great addition for maintainability.
I've left a couple of suggestions on the generate-tools.mjs script to improve its robustness and simplify the error handling. Overall, this is a solid contribution.
| .filter((f) => f.endsWith(".ts") && f !== "index.ts"); | ||
|
|
||
| const toolPromises = files.map(async (file) => { | ||
| const mod = await import(path.join(TOOLS_DIR, file)); |
There was a problem hiding this comment.
Dynamically importing TypeScript (.ts) files directly like this makes the script dependent on the execution environment being configured with a TypeScript loader (e.g., ts-node/esm). This can make the script less portable and harder to run locally. For a more robust solution, consider transpiling the TypeScript files to JavaScript before this script runs (e.g., in a previous workflow step), and then import the resulting .js files. This removes the dependency on a specific Node.js loader configuration.
| async function main() { | ||
| try { | ||
| const readme = fs.readFileSync(README_PATH, "utf8"); | ||
| const tools = await loadTools(); | ||
|
|
||
| if (tools.length === 0) { | ||
| console.warn("Warning: No tools found!"); | ||
| } | ||
|
|
||
| const updated = updateReadme({ readme, tools }); | ||
|
|
||
| fs.writeFileSync(README_PATH, updated); | ||
| console.log(`Synced ${tools.length} MCP tools to README.md`); | ||
| } catch (error) { | ||
| console.error("Error updating README:", error); | ||
| process.exit(1); | ||
| } | ||
| } | ||
|
|
||
| main().catch((err) => { | ||
| console.error(err); | ||
| process.exit(1); | ||
| }); |
There was a problem hiding this comment.
The error handling can be simplified by removing the try...catch block from within the main function and relying solely on the .catch() on the main() call. This is a common and clean pattern for handling errors in top-level async scripts and improves code readability.
| async function main() { | |
| try { | |
| const readme = fs.readFileSync(README_PATH, "utf8"); | |
| const tools = await loadTools(); | |
| if (tools.length === 0) { | |
| console.warn("Warning: No tools found!"); | |
| } | |
| const updated = updateReadme({ readme, tools }); | |
| fs.writeFileSync(README_PATH, updated); | |
| console.log(`Synced ${tools.length} MCP tools to README.md`); | |
| } catch (error) { | |
| console.error("Error updating README:", error); | |
| process.exit(1); | |
| } | |
| } | |
| main().catch((err) => { | |
| console.error(err); | |
| process.exit(1); | |
| }); | |
| async function main() { | |
| const readme = fs.readFileSync(README_PATH, "utf8"); | |
| const tools = await loadTools(); | |
| if (tools.length === 0) { | |
| console.warn("Warning: No tools found!"); | |
| } | |
| const updated = updateReadme({ readme, tools }); | |
| fs.writeFileSync(README_PATH, updated); | |
| console.log(`Synced ${tools.length} MCP tools to README.md`); | |
| } | |
| main().catch((error) => { | |
| console.error("Error updating README:", error); | |
| process.exit(1); | |
| }); |
Summary
Test plan
Checked 13 files in 8ms. No fixes applied.)
RUN v3.2.4 /Users/srujangurram/Developer/BrainDAO/MCPs/mcp-near
✓ src/tests/event-listener.test.ts (8 tests) 5ms
✓ src/tests/auth-manager.test.ts (16 tests) 6ms
Test Files 2 passed (2)
Tests 24 passed (24)
Start at 02:58:23
Duration 329ms (transform 52ms, setup 0ms, collect 79ms, tests 11ms, environment 0ms, prepare 120ms))
🤖 Generated with Claude Code