-
Notifications
You must be signed in to change notification settings - Fork 47
add: context7 breakdown #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🤖 Automatic Formatting Applied Files formatted: 1
View workflow run: View Run |
monotykamary
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
monotykamary
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content is mostly okay with a bit of weird formatting here and there. Although Context7 is essentially a "backend" app, it does deserve a video or a gif showing visually what it does on the developer's side.
Their homepage is also a great visual reminder of how Context7 can dynamically sort and organize context based on a target size:
context7.mp4
breakdown/context7.md
Outdated
| ```typescript | ||
| // Actual CLI argument processing from Context7 MCP | ||
| const program = new Command() | ||
| .option("--transport <stdio|http|sse>", "transport type", "stdio") | ||
| .option("--port <number>", "port for HTTP/SSE transport", "3000") | ||
| .allowUnknownOption() // let MCP Inspector / other wrappers pass through | ||
| .parse(process.argv); | ||
|
|
||
| // Validate and set transport type | ||
| const allowedTransports = ["stdio", "http", "sse"]; | ||
| if (!allowedTransports.includes(cliOptions.transport)) { | ||
| console.error( | ||
| `Invalid --transport value: '${cliOptions.transport}'. Must be one of: stdio, http, sse.` | ||
| ); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| // The clever bit: Auto-detection based on client | ||
| const TRANSPORT_TYPE = (cliOptions.transport || "stdio") as | ||
| | "stdio" // Cursor, Claude Desktop | ||
| | "http" // VS Code extensions | ||
| | "sse"; // Windsurf, streaming clients | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this related to Context7 or was there an idea to connect the dots with MCP a bit more here?
|
|
||
| Rule-based checks ensure structural completeness: | ||
|
|
||
| ````typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one too many backticks
| return cleanedCode.split(" ").filter(token => token.trim() !== "").length < 5; | ||
| }) | ||
| } | ||
| ```` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one too many backticks
|
|
||
| Prioritizes snippets that help developers get started: | ||
|
|
||
| ````typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one too many backticks
| return singleLine; | ||
| }) | ||
| } | ||
| ```` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one too many backticks
monotykamary
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
monotykamary
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.




No description provided.