Skip to content

feat: import mcp on resources server MJINT-175#13

Merged
KingPepito merged 6 commits into
mainfrom
feat/MJINT-175_Import_MCP_on_resources_server
Jul 16, 2026
Merged

feat: import mcp on resources server MJINT-175#13
KingPepito merged 6 commits into
mainfrom
feat/MJINT-175_Import_MCP_on_resources_server

Conversation

@KingPepito

Copy link
Copy Markdown
Collaborator

No description provided.

@KingPepito
KingPepito requested a review from a team as a code owner June 30, 2026 14:26
@KingPepito
KingPepito force-pushed the feat/MJINT-175_Import_MCP_on_resources_server branch 11 times, most recently from c6520f1 to 5087521 Compare July 7, 2026 08:58
@KingPepito
KingPepito force-pushed the feat/MJINT-175_Import_MCP_on_resources_server branch from 5087521 to eb5a3b2 Compare July 7, 2026 15:41
…JINT-175

- Pass user context within tools generation functions, enabling external use as well as internal with MAILJET_API_KEY environment variable.
- Export mcp information such as mcp specific header and package version.
- Prevent firing the mcp main script when imported as a package.
- Create index to export mcp and open api schema resources at once, edit the package.json export to match the new structure.
- Refactor getRequestOptionsMCPForAuth helper to use a auth as a parameter when needed.
@KingPepito
KingPepito force-pushed the feat/MJINT-175_Import_MCP_on_resources_server branch from eb5a3b2 to 2f3895b Compare July 7, 2026 15:59
Comment thread src/mailjet-mcp.js Outdated
Comment thread src/mailjet-mcp.js Outdated
Comment thread src/mailjet-mcp.js Outdated
Comment thread src/mailjet-mcp.js Outdated
Comment thread src/mailjet-mcp.js
Comment thread src/mailjet-mcp.js Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread src/mailjet-mcp.js
Comment thread src/mailjet-mcp.js Outdated
- Add test for `makeMailjetRequest`, asserting that it correctly uses params and env vars.
- Handle feedbacks from last review.
@KingPepito
KingPepito force-pushed the feat/MJINT-175_Import_MCP_on_resources_server branch from e4da098 to d9f8741 Compare July 8, 2026 16:24
obennett-m
obennett-m previously approved these changes Jul 8, 2026
@obennett-m obennett-m changed the title Feat/mjint 175 import mcp on resources server feat: import mcp on resources server MJINT-175 Jul 8, 2026
Comment thread package.json Outdated
Comment thread package.json
Comment thread src/mailjet-mcp.js Outdated
Comment thread src/mailjet-mcp.js
Comment thread src/mailjet-mcp.js
- add early return after rejecting missing API keys. Prevents request from continuing.
- add a network error handler in validateMailjetKeys,
- remove unnecessary try/catch in main.
- document getRequestOptionsMCPForAuth

@obennett-m obennett-m left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not quite sure this is ready after running locally. How about creating a beta package first - by bumping the package version to 1.1.0-beta.1?

Comment thread src/mailjet-mcp.js

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Mailjet MCP server package to be usable both as a CLI (stdio transport) and as an importable module, with support for passing per-session credentials into requests/tools.

Changes:

  • Add a module entrypoint (src/index.js) and configure package.json exports for library-style imports, plus bump version to 1.1.0.
  • Extend request/tool generation APIs to accept serverInstance and userContext, and add tests for makeMailjetRequest.
  • Update metadata/docs and housekeeping (changelog, start script, .gitignore).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/mailjet-mcp.js Adds import-vs-CLI behavior, shared headers/version exports, user-context credentials flow, and refactors OpenAPI parsing/tool generation usage.
tests/mailjet-mcp.test.js Adds unit tests covering makeMailjetRequest credential sourcing and error handling; introduces https request mocking.
src/index.js New module entrypoint re-exporting MCP server and schema modules.
package.json Version bump, adds exports entrypoint and a start script.
CHANGELOG.md Documents 1.1.0 changes and adds compare link.
.gitignore Ignores /ngrok.yml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mailjet-mcp.js
Comment thread src/mailjet-mcp.js
Comment thread src/mailjet-mcp.js Outdated
Comment thread tests/mailjet-mcp.test.js Outdated
Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
Comment thread src/mailjet-mcp.js
Comment on lines 569 to +575
});
});

req.on("error", (err) => {
// Catch network errors (e.g., DNS failure, no internet connection)
reject(`${err}\nNetwork unavailable. Credentials can not be validated.`);
});

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@KingPepito
KingPepito merged commit 1b797fe into main Jul 16, 2026
1 check passed
@KingPepito
KingPepito deleted the feat/MJINT-175_Import_MCP_on_resources_server branch July 16, 2026 14:40
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.

3 participants