KS
Killer-Skills

lsap-api-design — how to use lsap-api-design how to use lsap-api-design, lsap-api-design setup guide, what is lsap-api-design, lsap-api-design alternative, lsap-api-design vs Language Server Protocol, lsap-api-design install, lsap-api-design for AI coding agents, Language Server Agent Protocol tutorial, LSAP API design best practices

v1.0.0
GitHub

About this Skill

Ideal for AI Coding Agents requiring structured interaction with Language Servers via the LSAP protocol lsap-api-design is an open protocol defining interactions between AI coding agents and Language Servers, comprising three layers: Schema, Capability, and LSP.

Features

Defines Request/Response models using Pydantic
Utilizes Markdown templates for output
Employs semantic anchoring via Locate
Composes capabilities for business logic and LSP orchestration
Leverages the lsp-client library for raw protocol operations

# Core Topics

lsp-client lsp-client
[12]
[0]
Updated: 2/27/2026

Quality Score

Top 5%
42
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add lsp-client/LSAP

Agent Capability Analysis

The lsap-api-design MCP Server by lsp-client is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use lsap-api-design, lsap-api-design setup guide, what is lsap-api-design.

Ideal Agent Persona

Ideal for AI Coding Agents requiring structured interaction with Language Servers via the LSAP protocol

Core Value

Empowers agents to design and interact with LSAP APIs using a three-layered architecture, including schema, capability, and LSP layers, leveraging Pydantic for request/response models and Markdown templates for output

Capabilities Granted for lsap-api-design MCP Server

Designing new APIs for Language Server Agent Protocol
Implementing business logic and LSP orchestration for custom capabilities
Generating Markdown-first outputs with semantic anchoring via Locate

! Prerequisites & Limits

  • Requires understanding of LSAP protocol and Language Server architecture
  • Python-based implementation with Pydantic and lsp-client library dependencies
Project
SKILL.md
4.3 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

LSAP API Design

Guide for adding new APIs to LSAP. Study existing code as needed.

Architecture

Three layers:

  1. Schema (src/lsap/schema/): Request/Response models (Pydantic), Markdown templates
  2. Capability (src/lsap/capability/): Business logic, LSP orchestration
  3. LSP (lsp-client library): Raw protocol operations

Key Principles: Agent-cognitive design, Markdown-first output, semantic anchoring via Locate, composed capabilities

Reference Implementations

Study these before implementing:

  • Simple: src/lsap/schema/definition.py + src/lsap/capability/definition.py
  • Paginated: src/lsap/schema/reference.py + src/lsap/capability/reference.py
  • Multi-mode: src/lsap/schema/rename.py + src/lsap/capability/rename.py
  • Complex: src/lsap/schema/symbol.py + src/lsap/capability/symbol.py

Implementation Steps

1. Define Schema (src/lsap/schema/<name>.py)

See src/lsap/schema/definition.py for complete example.

Key components:

  • Request Model: Inherit from Request, LocateRequest, or PaginatedRequest
  • Response Model: Inherit from Response or PaginatedResponse
  • Markdown Template: Liquid template in model_config.json_schema_extra["markdown"]

Template basics (see docs/liquid_cheatsheet.md):

  • Conditionals: {% if items.size == 0 %}...{% endif %}
  • Loops: {% for item in items %}...{% endfor %}
  • Filters: {{ mode | capitalize }}, {{ path | join: "." }}

2. Implement Capability (src/lsap/capability/<name>.py)

See src/lsap/capability/definition.py for complete example.

Pattern:

python
1from attrs import define 2from .abc import Capability 3 4@define 5class MyCapability(Capability[MyRequest, MyResponse]): 6 async def __call__(self, req: MyRequest) -> MyResponse | None: 7 # 1. Locate position (if needed) 8 if not (loc_resp := await self.locate(req)): 9 return None 10 11 # 2. Call LSP operations via ensure_capability() 12 # 3. Process results (use asyncer.create_task_group for parallelism) 13 # 4. Return response (or None on failure)

Important: Return None on failure, not empty response.

3. Register Exports

Add to src/lsap/capability/__init__.py and src/lsap/schema/__init__.py

4. Add Tests

See tests/test_definition.py for examples. Must test: success case, not found case.

5. Add Documentation

Create schema/<name>.md with usage examples.

Common Patterns

Pagination

See src/lsap/capability/reference.py for complete pattern with PaginationCache and paginate().

Reading Code Context

python
1from lsap.utils.document import DocumentReader 2 3content = await self.client.read_file(file_path) 4reader = DocumentReader(content) 5snippet = reader.read(context_range, trim_empty=True)

Symbol Information

python
1from lsap.utils.symbol import symbol_at 2 3symbols = await ensure_capability( 4 self.client, WithRequestDocumentSymbol 5).request_document_symbol_list(file_path) 6 7if symbols and (match := symbol_at(symbols, position)): 8 symbol_path, symbol = match

LSP Capability Check

python
1from lsap.utils.capability import ensure_capability 2 3result = await ensure_capability( 4 self.client, 5 WithRequestReferences, 6 error="Fallback instructions if not supported" 7).request_references(file_path, position)

Common Utilities

See src/lsap/utils/ for implementations.

Path handling:

  • client.from_uri(uri) - Returns relative path by default
  • client.from_uri(uri, relative=False) - Returns absolute path

Position conversion:

  • Position.from_lsp(lsp_pos) - LSP (0-based) → LSAP (1-based)
  • lsap_pos.to_lsp() - LSAP (1-based) → LSP (0-based)

Hover content:

  • clean_hover_content(hover.value) - Removes LSP formatting artifacts

Checklists

Files to create:

  • src/lsap/schema/<name>.py
  • src/lsap/capability/<name>.py
  • tests/test_<name>.py
  • schema/<name>.md

Files to update:

  • src/lsap/schema/__init__.py
  • src/lsap/capability/__init__.py

Must verify:

  • Returns None on failure (not empty response)
  • Uses ensure_capability() for LSP operations
  • Concurrent operations use semaphores
  • Tests cover success and failure cases

Related Documentation

  • docs/locate_design.md - Position resolution patterns
  • docs/liquid_cheatsheet.md - Template syntax
  • CONTRIBUTING.md - Development workflow

Related Skills

Looking for an alternative to lsap-api-design or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication