KS
Killer-Skills

lsap-api-design — Categories.community

v1.0.0
GitHub

About this Skill

Ideal for AI Coding Agents requiring advanced Language Server interactions and LSAP protocol integration. LSAP (Language Server Agent Protocol) is an open protocol that defines how AI coding agents interact with Language Servers

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.

Ideal Agent Persona

Ideal for AI Coding Agents requiring advanced Language Server interactions and LSAP protocol integration.

Core Value

Empowers agents to design and implement LSAP APIs, leveraging Pydantic for request/response models, Markdown templates, and semantic anchoring via Locate, while orchestrating LSP operations through the lsp-client library.

Capabilities Granted for lsap-api-design MCP Server

Designing custom LSAP APIs for agent-specific use cases
Implementing business logic and capability composition using LSAP
Integrating LSAP with Language Servers for enhanced coding capabilities

! Prerequisites & Limits

  • Requires knowledge of LSAP protocol and Language Server architecture
  • Python-specific implementation using Pydantic and lsp-client library
  • Dependent on existing LSAP schema and capability layers for extension
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

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
Design

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

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