npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@363045841yyt/klinechart-ai-runtime

v0.1.1

Published

AI Native runtime for @363045841yyt/klinechart — MCP tool schemas, controller describe() output, chart state serialization.

Readme

@363045841yyt/klinechart-ai-runtime

MCP (Model Context Protocol) server and AI tool schemas for @363045841yyt/klinechart-core (npm) / @363045841yyt/klinechart (npm).

Optional addon — install only if you need AI agent / MCP control of your charts.

Provides a WebSocket-bridged MCP server that enables AI agents (via MCP Inspector or any MCP client) to control K-line chart operations — zoom, pan, add/remove indicators, change theme, and more.

Installation

pnpm add @363045841yyt/klinechart-ai-runtime

Requires @363045841yyt/klinechart-core as a peer dependency.

Quick Start

Start the MCP server

import { createMcpServer } from '@363045841yyt/klinechart-ai-runtime/mcp-server'

const { start, stop } = createMcpServer({
  ws: { port: 8080 },
})

await start()

Integrate with KLineChart (Vue example)

<script setup lang="ts">
import KLineChart from '@363045841yyt/klinechart'
import { executeTool } from '@363045841yyt/klinechart-ai-runtime'

const chartRef = ref<InstanceType<typeof KLineChart> | null>(null)

const mcpConfig = {
  wsUrl: 'ws://localhost:8080',
  autoReconnect: true,
  onToolCall: (call) => {
    const ctrl = chartRef.value?.getController?.()
    if (!ctrl) return { success: false, error: 'Controller not ready' }
    return executeTool(ctrl, call)
  },
}
</script>

<template>
  <KLineChart ref="chartRef" :mcp="mcpConfig" />
</template>

Connect from MCP Inspector

cd packages/ai-runtime
pnpm inspect

Then call tools like chart.zoomToLevel with { "level": 5 }.

Exports

Main entry (@363045841yyt/klinechart-ai-runtime)

| Export | Description | |--------|-------------| | executeTool | Dispatch a tool call to a chart controller | | ALL_TOOLS | Array of all supported tool schemas | | TOOL_GROUPS | Grouped tool definitions | | findTool(name) | Look up a tool schema by name | | describeVolumeProfileState | Generate VP state summary | | describeAnchoredVwap | Generate anchored VWAP summary | | describeFootprintLatestBar | Generate footprint summary | | describeAlerts | Generate alerts summary | | serialize / deserialize | Chart state serialization | | SessionRegistry | WebSocket session manager |

MCP Server (@363045841yyt/klinechart-ai-runtime/mcp-server)

| Export | Description | |--------|-------------| | createMcpServer(options) | Create MCP + WebSocket server instance |

Create with MCP (@363045841yyt/klinechart-ai-runtime/create-with-mcp)

Legacy helper — prefer executeTool + mcp prop pattern above.

Architecture

┌─────────────────┐        WebSocket          ┌───────────────────┐
│   Browser       │◄─────────────────────────►│  MCP Server       │
│                 │   register / tool:call    │  (Node.js)        │
│  KLineChart     │   tool:result /           │                   │
│  └─ ChartBridge │   state:update            │ ┌─ SessionRegistry│
│       ↓         │                           │ └─ WsSessionHandle│
│  └─ onToolCall ─┼───────────────────────────┼──► executeTool    │
└─────────────────┘                           └────────┬──────────┘
                                                       │ stdio
                                                       ▼
                                               ┌────────────────────┐
                                               │  MCP Client        │
                                               │  (Inspector / AI)  │
                                               └────────────────────┘

Available Tools

| Tool | Description | |------|-------------| | chart.zoomToLevel | Zoom to a specific level | | chart.setTheme | Switch between light/dark theme | | indicators.add | Add an indicator by definition ID | | indicators.remove | Remove an indicator by instance ID | | indicators.updateParams | Update indicator parameters |

License

MIT