
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@zapier/mcp-integration
Advanced tools
SDK for using remote Model Context Protocol (MCP) servers in/as Zapier integrations
SDK for using remote Model Context Protocol (MCP) servers in/as Zapier integrations.
To use @zapier/mcp-integration
, a Zapier integration needs to:
zapier-platform-core@17.7.0
or later.z.cache()
.The remote MCP server needs to:
To create an integration that primarily uses MCP, including to handle authentication, follow these steps.
Initialize the integration:
zapier init my-integration --language=typescript --module esm --template oauth2
cd my-integration
NOTE: We will provide a
mcp
template to replace some of the following steps.
Remove files we we won't need:
rm -rf src/test src/authentication.ts src/middleware.ts
Install this package and all other dependencies:
npm install @zapier/mcp-integration
Create src/mcp.ts
:
import { MCPIntegration } from '@zapier/mcp-integration';
import packageJson from '../package.json' with { type: 'json' };
export default new MCPIntegration({
name: packageJson.name,
version: packageJson.version,
serverUrl: 'https://example.com/mcp',
transport: 'streamable', // or 'sse'
auth: {
type: 'oauth2',
},
});
Replace https://example.com/mcp
with your remote MCP server URL, and change transport
when needed.
Create src/actions.generated.ts
:
export default {};
This is just for the next step to compile before we have actually generated actions.
Replace src/index.ts
:
import zapier from 'zapier-platform-core';
import packageJson from '../package.json' with { type: 'json' };
import mcp from './mcp.js';
import actions from './actions.generated.js';
export default mcp.defineApp({
version: packageJson.version,
platformVersion: zapier.version,
...actions,
});
Compile:
npm run build
NOTE: To not have to repeat this, add
"dev": "npm run build -- --watch",
to yourscripts
inpackage.json
, and keep a terminal window open runningnpm run dev
.
Create .env
:
CLIENT_ID='dynamic'
CLIENT_SECRET='dynamic'
This is because zapier invoke auth
does not support Dynamic Client Registration and assumes these to be needed.
Create a local connection:
zapier invoke auth start
NOTE: If you run into issues, make sure you at on 17.7.0 or later.
Generate the actions:
npx @zapier/mcp-integration generate
NOTE: If you get a "Missing or invalid access token" error, check
.env
to make sure there is a linebreak beforeauthData_type
. This is azapier-platform-cli
bug (#1129).
Register the integration:
zapier register
Push the integration:
zapier push
Request to have your integration be opted in to to use z.cache()
.
NOTE: This feature isn't enabled by default yet. Staff can enable it using the
zache
switch.
You can run npx @zapier/mcp-integration generate
at any time to generate actions for new tools and update actions when tools have changed.
NOTE: We don't yet delete generated actions for tools that no longer exist, but they will be dropped from
actions.generated.ts
.
After running the command again, run any linter and formatter tools before using git diff
to inspect the changes.
Once you have created or updated an MCP integration, run zapier validate
and perform manual tests (e.g. in a Zap) to identify where actions need to be customized using a transformer.
Create src/transformer.ts
:
import { defineTransformer, extendAction } from '@zapier/mcp-integration';
export default defineTransformer({
transformCreate: (action, tool) => {
console.log(`Create: ${action.key} / Tool: ${tool.name}`);
if (action.key === 'create_example') {
return extendAction(action).build();
} else {
return action;
}
},
transformSearch: (action, tool) => {
console.log(`Search: ${action.key} / Tool: ${tool.name}`);
return action;
},
transformTrigger: (action, tool) => {
console.log(`Trigger: ${action.key} / Tool: ${tool.name}`);
return action;
},
});
Hook the transformer up via src/mcp.ts
:
import transformer from './transformer.js';
export default new MCPIntegration({
transformer,
// ... other configuration options
});
The above setup won't have any effect. Read on how to chain calls on extendAction
to customize them.
Add fields:
extendAction(action)
.prependFields({ key: 'token', type: 'string', required: true })
.appendFields({ key: 'debug', type: 'boolean', default: false })
.build();
Modify fields:
extendAction(action)
.modifyField('page_id', (field) => ({
...field,
dynamic: 'list_pages.id.name',
}))
.build();
Replace all fields:
extendAction(action)
.replaceInputFields(
{ key: 'url', type: 'string', required: true },
{ key: 'method', type: 'string', choices: ['GET', 'POST', 'PUT'] },
)
.build();
Organize fields in the UI with groups:
export const inputFieldGroups = [
{ key: 'content', label: 'Content', emphasize: true },
{ key: 'formatting', label: 'Formatting', emphasize: false },
];
export const inputFields = [
{ key: 'title', type: 'string', required: true, group: 'content' },
{ key: 'text', type: 'text', required: true, group: 'content' },
{
key: 'formatting',
type: 'string',
list: true,
choices: { bold: 'Bold', italic: 'Italic' },
group: 'formatting',
},
];
extendAction(action)
.replaceInputFields(withNamedImport('../utils/myAction.js', 'inputFields'))
.replaceInputFieldGroups(
withNamedImport('../utils/myAction.js', 'inputFieldGroups'),
)
.build();
Link fields with given keys to use (custom) triggers to populate dynamic dropdowns:
const addDropdowns = addCommonDynamicDropdowns({
page_id: 'list_pages.id.name',
user_id: 'list_users.id.name',
});
extendAction(action).transformAllFields(addDropdowns).build();
Return undefined
instead of the (build customized) action to not have it generated.
transformTool: (tool) => {
// Make read-only tools generate search/trigger instead of create
if (tool.name === 'get-user') {
return {
...tool,
annotations: { ...tool.annotations, readOnlyHint: true },
};
}
return undefined; // unchanged
},
FAQs
SDK for using remote Model Context Protocol (MCP) servers in/as Zapier integrations
The npm package @zapier/mcp-integration receives a total of 223 weekly downloads. As such, @zapier/mcp-integration popularity was classified as not popular.
We found that @zapier/mcp-integration demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 306 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.