
Product
Introducing Reachability for PHP
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.
@modelcontextprotocol/server-basic-vanillajs
Advanced tools
Basic MCP App Server example using vanilla JavaScript
An MCP App example with a vanilla JavaScript UI (no framework).
[!TIP] Looking for a React-based example? See
basic-server-react!
Add to your MCP client configuration (stdio transport):
{
"mcpServers": {
"basic-vanillajs": {
"command": "npx",
"args": [
"-y",
"--silent",
"--registry=https://registry.npmjs.org/",
"@modelcontextprotocol/server-basic-vanillajs",
"--stdio"
]
}
}
}
To test local modifications, use this configuration (replace ~/code/ext-apps with your clone path):
{
"mcpServers": {
"basic-vanillajs": {
"command": "bash",
"args": [
"-c",
"cd ~/code/ext-apps/examples/basic-server-vanillajs && npm run build >&2 && node dist/index.js --stdio"
]
}
}
}
App class directlycallServerTool, sendMessage, sendLog, openLinkapplyDocumentTheme(), applyHostStyleVariables(), and applyHostFonts()server.ts - MCP server with tool and resource registrationmcp-app.html / src/mcp-app.ts - Vanilla JS UI using App classnpm install
npm run dev
get-time tool with metadata linking it to a UI HTML resource (ui://get-time/mcp-app.html).This example bundles into a single HTML file using Vite with vite-plugin-singlefile — see vite.config.ts. This allows all UI content to be served as a single MCP resource. Alternatively, MCP apps can load external resources by defining _meta.ui.csp.resourceDomains in the UI resource metadata.
FAQs
Basic MCP App Server example using vanilla JavaScript
The npm package @modelcontextprotocol/server-basic-vanillajs receives a total of 167 weekly downloads. As such, @modelcontextprotocol/server-basic-vanillajs popularity was classified as not popular.
We found that @modelcontextprotocol/server-basic-vanillajs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.

Product
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.