diff --git a/README.md b/README.md index 95c486c..c301425 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,7 @@ Features - Automatic JSON Schema & handler generation via Scala 3 macros - Seamless integration with the Java MCP SDK ---- - -## Installation (Coming Soon) +## Installation Add to your **`build.sbt`** (defaulting to **Scala 3.6.4**): @@ -18,68 +16,11 @@ Add to your **`build.sbt`** (defaulting to **Scala 3.6.4**): libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.0" ``` ---- - -## Developing Locally - -When hacking on *FastMCP‑Scala* itself, you can consume a local build in any project. - -### 🔨 Publish to the Local Ivy Repository with `sbt` (Recommended) - -```bash -# From the fast-mcp-scala root -sbt publishLocal -``` - -Then, in your consuming sbt project: +## Quickstart -```scala -libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.0-SNAPSHOT" -``` - -> `publishLocal` installs the artifact under `~/.ivy2/local` (or the Coursier cache when enabled). - ---- - -### 📦 Use the JAR Directly (Unmanaged Dependencies) - -```bash -# Package the library -sbt package - -# Copy the JAR – adjust Scala version / name if you change them -cp target/scala-3.6.4/fast-mcp-scala_3-0.1.0-SNAPSHOT.jar \ - /path/to/other-project/lib/ -``` - -Unmanaged JARs placed in a project’s `lib/` folder are picked up automatically by sbt. - ---- - -### 🚀 Using with **scala‑cli** - -You can use `fast-mcp-scala` in another scala‑cli project: ```scala //> using scala 3.6.4 -//> using dep com.tjclp::fast-mcp-scala:0.1.0-SNAPSHOT -//> using options "-Xcheck-macros" "-experimental" -``` - -You can also point directly at the local JAR: - -```scala -//> using scala 3.6.4 -//> using lib "/absolute/path/to/fast-mcp-scala_3-0.1.0-SNAPSHOT.jar" -//> using options "-Xcheck-macros" "-experimental" -``` - ---- - -## Quickstart (Annotation‑based) - -```scala -//> using scala 3.6.4 -//> using dep com.tjclp::fast-mcp-scala:0.1.0-SNAPSHOT +//> using dep com.tjclp::fast-mcp-scala:0.1.0 //> using options "-Xcheck-macros" "-experimental" import com.tjclp.fastmcp.core.{Tool, ToolParam, Prompt, PromptParam, Resource} @@ -113,15 +54,103 @@ object ExampleServer extends ZIOAppDefault: yield () ``` -The above example can be run using `scala-cli scripts/quickstart.scala` from the repo root (make sure to run `sbt publishLocal` first). You can run the server via the MCP inspector by running +### Running Examples + +The above example can be run using `scala-cli scripts/quickstart.scala` from the repo root. You can run the server via the MCP inspector by running: + +```bash +npx @modelcontextprotocol/inspector scala-cli /scripts/quickstart.scala +``` + +You can also run examples directly from the command line: ```bash - npx @modelcontextprotocol/inspector scala-cli /scripts/quickstart.scala +scala-cli \ + -e '//> using dep com.tjclp::fast-mcp-scala:0.1.0' \ + --main-class com.tjclp.fastmcp.examples.AnnotatedServer ``` +### Integration with Claude Desktop + +In Claude desktop, you can add the following to your `claude_desktop_config.json`: + +```json +{ + "mcpServers": { + "example-fast-mcp-server": { + "command": "scala-cli", + "args": [ + "-e", + "//> using dep com.tjclp::fast-mcp-scala:0.1.0", + "--main-class", + "com.tjclp.fastmcp.examples.AnnotatedServer" + ] + } + } +} +``` + +> Note: FastMCP-Scala example servers are for demo purposes only and don't do anything useful + For additional examples and in‑depth docs, see **`docs/guide.md`**. +## License + +[MIT](LICENSE) + --- -## License +## Development Documentation + +### Developing Locally + +When hacking on *FastMCP‑Scala* itself, you can consume a local build in any project. + +#### 🔨 Publish to the Local Ivy Repository with `sbt` + +In your cloned repository, set a working version +```scala +ThisBuild / version := "0.1.1-SNAPSHOT" +``` -[MIT](LICENSE) \ No newline at end of file +```bash +# From the fast-mcp-scala root +sbt publishLocal +``` + +Then, in your consuming sbt project: + +```scala +libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.1-SNAPSHOT" +``` + +> `publishLocal` installs the artifact under `~/.ivy2/local` (or the Coursier cache when enabled). + +#### 📦 Use the JAR Directly (Unmanaged Dependencies) + +```bash +# Package the library +sbt package + +# Copy the JAR – adjust Scala version / name if you change them +cp target/scala-3.6.4/fast-mcp-scala_3-0.1.1-SNAPSHOT.jar \ + /path/to/other-project/lib/ +``` + +Unmanaged JARs placed in a project's `lib/` folder are picked up automatically by sbt. + +#### 🚀 Using with `scala‑cli` + +You can use `fast-mcp-scala` in another scala‑cli project: +```scala +//> using scala 3.6.4 +//> using dep com.tjclp::fast-mcp-scala:0.1.0 +//> using options "-Xcheck-macros" "-experimental" +``` + +You can also point directly at the local JAR: + +```scala +//> using scala 3.6.4 +//> using lib "/absolute/path/to/fast-mcp-scala_3-0.1.0.jar" +//> using options "-Xcheck-macros" "-experimental" +``` \ No newline at end of file diff --git a/build.sbt b/build.sbt index 7486c73..24d0f01 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,7 @@ sonatypeTimeoutMillis := 60000 ThisBuild / sonatypeCredentialHost := sonatypeCentralHost -ThisBuild / version := "0.1.0" +ThisBuild / version := "0.1.1-SNAPSHOT" ThisBuild / scalaVersion := "3.6.4" // Using Scala 3 ThisBuild / versionScheme := Some("semver-spec") diff --git a/scripts/examples.scala b/scripts/examples.scala index 8e52b4b..215d486 100644 --- a/scripts/examples.scala +++ b/scripts/examples.scala @@ -1,5 +1,5 @@ //> using scala "3.6.4" -//> using dep com.tjclp::fast-mcp-scala:0.1.0-SNAPSHOT +//> using dep com.tjclp::fast-mcp-scala:0.1.0 //> using options "-Xcheck-macros" "-experimental" // Enable verbose macro processing // This is a launcher file for scala-cli diff --git a/scripts/quickstart.scala b/scripts/quickstart.scala index a9da27b..4b256ae 100644 --- a/scripts/quickstart.scala +++ b/scripts/quickstart.scala @@ -1,5 +1,5 @@ //> using scala 3.6.4 -//> using dep com.tjclp::fast-mcp-scala:0.1.0-SNAPSHOT +//> using dep com.tjclp::fast-mcp-scala:0.1.0 //> using options "-Xcheck-macros" "-experimental" import com.tjclp.fastmcp.core.{Tool, ToolParam, Prompt, PromptParam, Resource}