loading…
Search for a command to run...
loading…
A Model Context Protocol server for the Colombo Stock Exchange that enables users to search listed companies, fetch stock quotes, and retrieve real-time market
A Model Context Protocol server for the Colombo Stock Exchange that enables users to search listed companies, fetch stock quotes, and retrieve real-time market snapshots. It provides a structured interface for AI tools to access CSE data, including top gainers, losers, and index summaries.
@gajarthan/cse-mcp is a TypeScript Model Context Protocol server for the Colombo Stock Exchange. It gives MCP-compatible clients a clean way to search listed companies, fetch normalized single-stock quotes, and retrieve market-wide snapshots such as status, summary, top gainers, top losers, and index data. It is built for developers, analysts, and AI-tool builders who want fast access to CSE data through a stable MCP tool surface instead of scraping raw website responses inside prompts.
companyInfoSummerymarketStatus, marketSummery, topGainers, topLooses, aspiData, and snpDatastdio-based MCP clientshttps://www.cse.lk/api/. Response shapes may change without notice.stdio transport only. It does not yet expose a remote HTTP or SSE MCP endpoint.https://www.cse.lkstdio serversBuild locally:
npm install
npm run build
Minimum local MCP config:
{
"mcpServers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
If you are developing locally, MCP Inspector is the fastest smoke test:
npm run inspector
If the package is published to npm, the fastest install path becomes:
{
"mcpServers": {
"cse": {
"command": "npx",
"args": ["-y", "@gajarthan/cse-mcp"]
}
}
}
Use search_company to find John Keells Holdings, then call get_stock_quote for the correct symbol.
This server supports local stdio usage only. In most clients, you can configure it in one of two ways:
node C:/absolute/path/to/cse-mcp/dist/index.jsnpx -y @gajarthan/cse-mcpstdio vs remote HTTPstdio MCP clients that launch a process with command and argsClaude Code documents MCP support and works well with local stdio servers.
Add the server directly:
claude mcp add-json cse "{\"type\":\"stdio\",\"command\":\"node\",\"args\":[\"C:/absolute/path/to/cse-mcp/dist/index.js\"]}"
Published-package variant:
claude mcp add-json cse "{\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"@gajarthan/cse-mcp\"]}"
Or use .mcp.json:
{
"mcpServers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
If Claude Desktop is already configured, you can also import those MCP entries into Claude Code:
claude mcp add-from-claude-desktop
OpenAI documents MCP configuration in ~/.codex/config.toml, and the Codex CLI and IDE extension share it.
CLI setup:
codex mcp add cse -- node C:/absolute/path/to/cse-mcp/dist/index.js
Published-package CLI setup:
codex mcp add cse -- npx -y @gajarthan/cse-mcp
config.toml setup:
[mcp_servers.cse]
command = "node"
args = ["C:/absolute/path/to/cse-mcp/dist/index.js"]
Published-package config.toml setup:
[mcp_servers.cse]
command = "npx"
args = ["-y", "@gajarthan/cse-mcp"]
Cursor MCP support is version-dependent. In versions that support local MCP servers, use a config equivalent to:
{
"mcpServers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
If the client supports npx, you can usually replace the command with:
{
"mcpServers": {
"cse": {
"command": "npx",
"args": ["-y", "@gajarthan/cse-mcp"]
}
}
}
Verify the exact config path and UI flow in your installed Cursor version.
VS Code and GitHub Copilot MCP support is version-dependent. In builds that support local MCP servers, the common pattern is a workspace or user mcp.json-style config using command and args:
{
"servers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
Verify the exact file location and schema for your VS Code or Copilot version before relying on this example.
Cline MCP support is version-dependent. In versions that support local MCP stdio servers, use the same process-launch pattern:
{
"mcpServers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
Verify the current config file name and location in the Cline docs or extension UI.
Continue support is version-dependent and may be configured through its YAML or UI-based MCP settings. The practical local setup is still the same:
mcpServers:
cse:
command: node
args:
- C:/absolute/path/to/cse-mcp/dist/index.js
Verify the current Continue config format for your installed version.
Roo Code MCP support is version-dependent. Use the same local stdio command pattern in the version-specific MCP settings:
{
"mcpServers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
TODO: verify and document the exact current Roo Code config path.
Gemini CLI MCP support is version-dependent. For versions that support local MCP servers, configure this server as a local stdio process:
{
"mcpServers": {
"cse": {
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
}
}
Verify the current Gemini CLI config path and schema in the version you are using.
This project is intended for Smithery publishing through the GitHub repository integration path.
What is verified:
stdio MCP server@gajarthan/cse-mcpWhat is intentionally not supported today:
For Smithery, that means the practical route is to connect the GitHub repo and let Smithery build from the repository, branch, and base directory instead of requiring a public MCP URL.
Recommended Smithery settings for this repo:
Gajarthan/cse-mcpmaster.See SMITHERY.md for the full GitHub-to-Smithery workflow, checklists, and common failure points.
This repository already includes tag-driven release automation in .github/workflows/release.yml.
To create a GitHub release:
package.json, src/index.ts, server.json, and glama.json to the intended versionnpm run release:checkv2.0.1The workflow validates the release on both Ubuntu and Windows before drafting the GitHub release.
search_companySearch the local CSV catalog by company name or ticker symbol.
Input:
{
"query": "john keells"
}
Returns:
get_stock_quoteFetch a normalized quote for a valid CSE symbol.
Input:
{
"symbol": "JKH.N0000"
}
Returns:
get_market_statusFetch the current market session string from CSE and normalize it to a status plus inferred open/closed signal.
Input:
{}
get_market_summaryFetch market-wide turnover, share volume, trade count, and trade date.
Input:
{}
get_top_gainersFetch the top market gainers.
Input:
{
"limit": 10
}
Notes:
limit is 10limit is 25get_top_losersFetch the top market losers.
Input:
{
"limit": 10
}
Notes:
limit is 10limit is 25get_index_summaryFetch one or both supported index summaries.
Input:
{
"index": "all"
}
Allowed values:
aspisnpallstdio only10000ms2This project does not currently expose custom CLI flags. Run it with:
node dist/index.js
This project does not currently require or document custom environment variables.
If timeout, retry count, base URL override, or CSV path override should become user-configurable, they should be added explicitly and documented here rather than inferred from source code.
stdio transport onlystdio MCP serversargs is absolutenpm run build before pointing the client at dist/index.jsnpx @gajarthan/cse-mcp works from your terminalRun the server directly to inspect stderr:
node dist/index.js
Check:
dist/index.js existssearch_company first to confirm the exact CSE symbolcse_companies.csvsrc/services/cseApi.tsThat is expected for now. This server is stdio-only, while ChatGPT's documented remote MCP flow expects SSE or streaming HTTP.
Use an absolute path and forward slashes in JSON config when possible:
{
"command": "node",
"args": ["C:/absolute/path/to/cse-mcp/dist/index.js"]
}
If you do not want to deal with local paths, prefer the published package form:
{
"command": "npx",
"args": ["-y", "@gajarthan/cse-mcp"]
}
If a client has trouble launching the package directly, use the explicit npm package form:
{
"command": "npx",
"args": ["-y", "-p", "@gajarthan/cse-mcp", "cse-mcp"]
}
Install and build:
npm install
npm run build
Useful scripts:
npm run dev - watch-mode development with tsxnpm run build - compile TypeScript to dist/npm run typecheck - run TypeScript checks without emitting filesnpm run start - start the compiled servernpm run inspector - launch MCP Inspector against the local buildnpm run pack:check - verify npm package contents without publishingnpm run release:check - run typecheck, build, tests, and npm pack validationRecommended local workflow:
npm installnpm run typechecknpm run buildnpm run inspectorsearch_companyget_stock_quoteget_market_summaryget_index_summaryProject layout:
src/index.ts - MCP server bootstrap and stdio transportsrc/services/companyLookup.ts - CSV-backed symbol and company searchsrc/services/cseApi.ts - CSE API HTTP calls, validation, retries, and normalizationsrc/tools/*.ts - individual MCP tool definitionssrc/utils/errors.ts - safe error handling and stderr loggingsrc/utils/formatters.ts - output formatting and normalization helpersSee CHANGELOG.md.
This is an open source project, and contributions are welcome.
See CONTRIBUTING.md for local setup, validation steps, and pull request expectations.
Suggested contribution flow:
npm installnpm run typechecknpm run buildHigh-value contribution areas:
chartData, allSectors, and announcementsIf you discover a changed CSE response shape, include a sanitized example payload in the issue or PR whenever possible.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"cse-mcp-server": {
"command": "npx",
"args": []
}
}
}