Server scripts

Server scripts are individual JavaScript or TypeScript files that run on the Neptune DXP - Open Edition server. They can be grouped into script projects. The MCP server provides tools for both project-level and individual script operations.

Required access: the Script Editor tool (scripteditor) in one of your roles. Display access is enough to list and read script projects and scripts. Creating and deleting projects, saving and deleting scripts, and running a script require Edit access.

If none of your roles includes this tool with the required access, the tool fails immediately with an access denied error. Contact an administrator to request access, or see Access control for more information on how access is enforced.

Available tools

Script projects

Script projects group related server scripts together. Use the project-level tools to manage those groupings.

Tool Description

list_script_projects

List all server script projects with their scripts. Each project groups related scripts together.

get_script_project

Return a server script project by its ID, including all its scripts.

create_script_project

Create a new server script project with a name, a description, and a development package.

delete_script_project

Delete a server script project by its ID.

Individual scripts

Tool Description

get_server_script

Return a server script by its ID, including its source code.

save_server_script

Create or update a server script in JavaScript or TypeScript. Omit id to create a new script. TypeScript scripts are transpiled automatically. A script can be assigned to a script project and can declare dependencies on APIs, entity sets, agents, global scripts, and external npm modules.

delete_server_script

Delete a server script by its ID. Pass the ID of the parent script project so that the project version is updated after the deletion.

list_ungrouped_scripts

List server scripts that are not assigned to any project.

run_server_script

Execute a server script by its ID. The body, path parameters, query parameters, and headers that you pass are available to the script as req.body, req.params, req.query, and req.headers. Returns the script result object: data, statusCode, contentType, filename, and headers when set. The run skips the role checks of API artifacts, debugger conditions, execution in a separate process, and stream piping.

Was this page helpful?

What made the biggest difference for you?
What went wrong? (Your feedback helps us fix it.)

Please don't include personal or sensitive data.